//
//  ViewController.m
//  测试SDK2
//
//  Created by HW1-MM02 on 2016/12/22.
//  Copyright © 2016年 HW1-MM02. All rights reserved.
//

#import "ViewController.h"
#import "MApi.h"
#import "NSObject+Ext.h"

//#ifdef DEBUG
//
//#define NSLog(FORMAT, ...) fprintf(stderr, "%s:%zd\t%s\n", [[[NSString stringWithUTF8String: __FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat: FORMAT, ## __VA_ARGS__] UTF8String]);
//
//#else
//
//#define NSLog(FORMAT, ...) nil
//
//#endif

@interface ViewController ()
@property (nonatomic,strong) NSDictionary * data;
@property (nonatomic,strong)NSMutableArray *arrrr;
@property (nonatomic,strong)NSMutableDictionary *adiccc;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    UILabel * label=[[UILabel alloc] initWithFrame:CGRectMake(12, 20, 200, 80)];
    label.text=@"这是测试SDK的应用";
    [self.view addSubview:label];
    
    _arrrr = [[NSMutableArray alloc]init];
    _adiccc = [[NSMutableDictionary alloc]init];
    UIButton * btn=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn.frame=CGRectMake(12, 100, 100, 40);
    [btn setTitle:@"点击保存" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(ceshi) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    [self registerServer];
    
//    UIButton * btn1=[UIButton buttonWithType:UIButtonTypeRoundedRect];
//    btn1.frame=CGRectMake(12, 200, 100, 40);
//    [btn1 setTitle:@"点击重新认证" forState:UIControlStateNormal];
//    [btn1 addTarget:self action:@selector(registerServer1) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:btn1];
}

//-(void)changeIPList{
//
//    NSArray *serverList =  [MApi serverListWithMarket:MApiMarketSH permission:MApiSourceLevel1];
//    NSLog(@"IP地址列表%@",serverList);
//
//    NSArray *List = [NSArray arrayWithObjects:@"http://114.80.155.134:22016",@"http://114.80.155.139:22016",nil];
//    [MApi resetServerList:List withMarket:MApiMarketBJ permission:MApiSourceLevel1];
//
//    //练习:证券行情列表
//    MQuoteRequest *request = [[MQuoteRequest alloc] init];
//    request.code = @"832982.bj"; //填入股票代码
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MQuoteResponse *response = (MQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.stockItems;
//            for (int i=0; i<item.count; i++) {
//                MStockItem *items = item[i];
//                NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@",items.datetime,items.ID,items.name,items.lastPrice,items.preClosePrice,items.capitalization,items.totalValue,items.circulatingShare,items.flowValue,items.receipts,items.PE,items.SPE);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"证券行情列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
-(void)ceshi{
    NSLog(@"dianjianniu");
    for (int i = 0; i<_adiccc.count; i++){
        NSLog(@"%@",_adiccc[[NSString stringWithFormat:@"%d",i]]);
    }
}
//
//    //练习:行情快照
//    MSnapQuoteRequest *request1 = [[MSnapQuoteRequest alloc] init];
//    request1.code = @"832982.bj"; //填入股票代码
//    request1.tickCount = 10;
//
//    //发送请求
//    [MApi sendRequest:request1 completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MSnapQuoteResponse *response = (MSnapQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            MStockItem *item = response.stockItem;
//            NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@",item.ID,item.name,item.lastPrice,item.preClosePrice,item.capitalization,item.totalValue,item.circulatingShare,item.flowValue,item.receipts,item.PE,item.SPE);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"回传代码：%ld",resp.status);
//            //NSLog(@"错误站点信息：%@",request.ip);
//            NSLog(@"行情快照请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//}

//-(void)registerServer1{
//
//    [MApi setDebugMode:@{@"token":@"|F)w*7sYaoIdM+!#8d10LsT#0x|cA.xX/a@;a~",@"enabled":@YES,@"mode":@7}];
//    [MApi registerAPP:[[NSBundle mainBundle] infoDictionary][@"MApiAppKey"]
//    sourcePermissions:@{MApiMarketSH:@(MApiSourceLevel1),
//                        MApiMarketSZ:@(MApiSourceLevel1),
//                        MApiMarketHK:@(MApiSourceHK10),
//                        MApiMarketCFF:@(MApiSourceCFF1),
//                        MApiMarketDCE:@(MApiSourceDCE1),
//                        MApiMarketCZCE:@(MApiSourceCZCE1),
//                        MApiMarketSHFE:@(MApiSourceSHFE1),
//                        MApiMarketINE:@(MApiSourceINE1)
//                        }
//              options:@{MApiRegisterOptionGetServerPoolingTimeKey:@120,MApiIgnoreRestoreAuthInfoKey:@(YES)}
//    completionHandler:^(NSError *error) {
//        if (!error) {
//            NSLog(@"重新认证成功");
//        }
//        else {
//            NSLog(@"重新认证失败, %@", error);
//            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" message:[error localizedDescription] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
//            [alert show];
//        }
//    }];
//}

- (void)registerServer {

    [MApi setDebugMode:@{@"token":@"|F)w*7sYaoIdM+!#8d10LsT#0x|cA.xX/a@;a~",@"enabled":@YES,@"mode":@7}];
    [MApi registerAPP:[[NSBundle mainBundle] infoDictionary][@"MApiAppKey"]
    sourcePermissions:@{MApiMarketSH:@(MApiSourceLevel1),
                            MApiMarketSZ:@(MApiSourceLevel1),
                             MApiMarketSZ:@(MApiSourceLevel1),
                            MApiMarketBJ:@(MApiSourceLevel1),
                            MApiMarketHK:@(MApiSourceHKD1|MApiSourceSZHK5|MApiSourceHK10),
                            MApiMarketCFF:@(MApiSourceCFF1),
                            MApiMarketDCE:@(MApiSourceDCE1),
                            MApiMarketCZCE:@(MApiSourceCZCE1),
                            MApiMarketSHFE:@(MApiSourceSHFE1),
                            MApiMarketINE:@(MApiSourceINE1)
                  
    }
//              options:@{MApiRegisterOptionGetServerPoolingTimeKey:@120}
//              options:@{MApiRegisterOptionGetServerPoolingTimeKey:@120,@"MAPI_DEBUG_QUOTE_SERVERS":@{@"nf":@[@{@"ip":@"http://114.80.155.58:22013"}],@"sh":@[@{@"ip":@"http://114.80.155.61:22016"}],@"pb":@[@{@"ip":@"http://114.80.155.58:22016"}],@"bj":@[@{@"ip":@"http://114.80.155.58:22016"}],@"sh":@[@{@"ip":@"http://114.80.155.58:22016"}]}}
    options:@{MApiRegisterOptionGetServerPoolingTimeKey:@120
              ,@"MAPI_DEBUG_AUTH_SERVERS":@[@"http://114.80.155.134:22016"],@"MAPI_DEBUG_QUOTE_SERVERS":@{ @"pb":@[@{@"ip":@"http://114.80.63.252:22016"}], @"sh":@[@{@"ip":@"http://61.152.149.1:22016"},@{@"ip":@"tcp://61.152.149.1:22017"}], @"shl2":@[@{@"ip":@"http://27.151.2.88:22016"},@{@"ip":@"tcp://114.80.155.62:22017"}], @"sz":@[@{@"ip":@"http://114.80.155.61:22016"},@{@"ip":@"tcp://114.80.155.61:22017"}], @"szl2":@[@{@"ip":@"http://114.80.155.57:22016"},@{@"ip":@"tcp://114.80.155.57:22017"}], @"hk":@[@{@"ip":@"http://58.63.252.56:22016"}], @"hk1":@[@{@"ip":@"http:/58.63.252.56:22016"}], @"hk5":@[@{@"ip":@"http://114.80.155.58:8601"}], @"hk10":@[@{@"ip":@"http://114.80.155.133:22016"}], @"hka1":@[@{@"ip":@"http://114.80.155.58:8601"}], @"hkd1":@[@{@"ip":@"http://114.80.155.58:8601"}],  @"hkaz":@[@{@"ip":@"http://58.63.252.56:22016"}], @"hkdz":@[@{@"ip":@"http://58.63.252.56:22016"}], @"cff":@[@{@"ip":@"http://114.80.155.61:22016"}], @"cf":@[@{@"ip":@"http://114.80.155.61:22016"}], @"gf":@[@{@"ip":@"http://114.80.155.61:22016"}], @"fe":@[@{@"ip":@"http://114.80.155.61:22016"}], @"bj":@[@{@"ip":@"http://114.80.63.252:22016"}], @"nf":@[@{@"ip":@"http://114.80.155.57:22013"}],
                  @"kfpt":@[@{@"ip":@"https://yunqzly.sseinfo.com:22011"}], @"bz":@[@{@"ip":@"http://61.152.149.1:22016"}],
              }
    }
//国产
//     options:@{MApiRegisterOptionGetServerPoolingTimeKey:@120,@"MAPI_DEBUG_AUTH_SERVERS":@[@"http://114.80.155.134:22016"],@"MAPI_DEBUG_QUOTE_SERVERS":@{@"pb":@[@{@"ip":@"http://222.73.139.202:22016"}],@"sh":@[@{@"ip":@"http://222.73.139.202:22016"},@{@"ip":@"tcp://114.80.155.134:22017"}],@"shl2":@[@{@"ip":@"http://222.73.139.209:22016"},@{@"ip":@"tcp://114.80.155.62:22017"}],@"sz":@[@{@"ip":@"http://222.73.139.202:22016"},@{@"ip":@"tcp://114.80.155.134:22017"}],@"szl2":@[@{@"ip":@"http://222.73.139.210:22016"},@{@"ip":@"tcp://114.80.155.47:22017"}],@"hk":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hk1":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hk5":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hk10":@[@{@"ip":@"http://222.73.139.208:22016"}],@"hka1":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hkd1":@[@{@"ip":@"http://114.80.155.139:22016"}],@"hkl2":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hkaz":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hkdz":@[@{@"ip":@"http://114.80.155.139:22016"}],@"cff":@[@{@"ip":@"http://222.73.139.202:22016"}],@"cf":@[@{@"ip":@"http://222.73.139.202:22016"}],@"gf":@[@{@"ip":@"http://114.80.155.134:22016"}],@"fe":@[@{@"ip":@"http://114.80.155.61:22016"}],@"bj":@[@{@"ip":@"http://222.73.139.202:22016"}],@"nf":@[@{@"ip":@"http://114.80.155.134:22013"}]}}
     //生产
//options:@{MApiRegisterOptionGetServerPoolingTimeKey:@120,@"MAPI_DEBUG_AUTH_SERVERS":@[@"http://114.80.155.134:22016"],@"MAPI_DEBUG_QUOTE_SERVERS":@{@"pb":@[@{@"ip":@"http://180.163.112.216:22016"}],@"sh":@[@{@"ip":@"http://180.163.112.216:22016"},@{@"ip":@"tcp://114.80.155.134:22017"}],@"shl2":@[@{@"ip":@"http://180.163.112.217:22016"},@{@"ip":@"tcp://114.80.155.62:22017"}],@"sz":@[@{@"ip":@"http://180.163.112.216:22016"},@{@"ip":@"tcp://114.80.155.134:22017"}],@"szl2":@[@{@"ip":@"http://114.80.155.121:22016"},@{@"ip":@"tcp://114.80.155.47:22017"}],@"hk":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hk1":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hk5":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hk10":@[@{@"ip":@"http://123.125.108.248:22016"}],@"hka1":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hkd1":@[@{@"ip":@"http://114.80.155.139:22016"}],@"hkl2":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hkaz":@[@{@"ip":@"http://114.80.155.133:22016"}],@"hkdz":@[@{@"ip":@"http://114.80.155.139:22016"}],@"cff":@[@{@"ip":@"http://180.163.112.216:22016"}],@"cf":@[@{@"ip":@"http://180.163.112.216:22016"}],@"gf":@[@{@"ip":@"http://114.80.155.134:22016"}],@"fe":@[@{@"ip":@"http://114.80.155.61:22016"}],@"bj":@[@{@"ip":@"http://180.163.112.216:22016"}],@"nf":@[@{@"ip":@"http://114.80.155.57:22013"}],@"nfcls":@[@{@"ip":@"http://114.80.155.134:22013"}]}}
     
    completionHandler:^(NSError *error) {
//        Class class = NSClassFromString(@"MAuthRequest");
//        MRequest *request = [class new];
//        NSLog(@"%@",[request performSelector:@selector(postParam) withObject:nil]);
        if (!error) {

            NSLog(@"注册成功");
            NSLog(@"version:%@",[MApi version]);
            
//            NSArray *serverList =  [MApi serverListWithMarket:MApiMarketHK permission:MApiSourceHKDZ];
//            NSLog(@"IP地址列表%@",serverList);
////            NSArray *List = [NSArray arrayWithObjects:@"http://114.80.155.134:22016",@"http://114.80.155.133:22016",nil];
//            [MApi resetServerList:serverList withMarket:MApiMarketSH permission:MApiSourceLevel1];
//            for (int num=0;num<serverList.count;num++) {
////                NSLog(@"%lu",serverList.count);
//                MPingRequest *request = [[MPingRequest alloc] init];
//
//                request.URLString = serverList[num];
////                NSLog(@"%@",serverList[num]);
//                //发送请求
//                [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//                    if (resp.status==MResponseStatusSuccess) {
//                        MPingResponse *response = (MPingResponse *)resp;
//                        NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                        self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////                        NSLog(@"1----%@",response);
//                        NSString   *items = response.IPAddress;
//                        NSTimeInterval   Arrs = response.responseTime;
//                        NSLog(@"IP地址：%@,响应时间：%f",items,Arrs);
//
//                    } else {
//                        //应答错误，显示错误信息
//                        NSLog(@"获取资讯源类别请求错误，错误信息是：%@",resp.message);
//                    }
//
//                }];
//
//
//            }

        }
        else {
            NSLog(@"注册失败, %@", error);
            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" message:[error localizedDescription] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [alert show];
        }
    }];

    //练习:版本检查
//    MCheckVersionRequest *request = [[MCheckVersionRequest alloc] init];
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status==MResponseStatusSuccess) {
//            MCheckVersionResponse *response = (MCheckVersionResponse *)resp;
//            //NSDictionary * data=response.sourceClassInfos;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"版本检查请求错误，错误信息是：%@",resp.message);
//        }
//        
//    }];
    
    //练习:获取资讯源类别
//    MGetSourceRequest *request = [[MGetSourceRequest alloc] init];
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status==MResponseStatusSuccess) {
//            MGetSourceResponse *response = (MGetSourceResponse *)resp;
//            //            NSDictionary * data=response.sourceClassInfos;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"获取资讯源类别请求错误，错误信息是：%@",resp.message);
//        }
//    
//    }];
    
    //获取各市场站点
//    NSArray *serverList;
//    NSArray *market = @[@"sh"];
//    NSArray *level = @[@"MApiSourceLevel1"];
//    for (int i=0; i<market.count; i++) {
//        serverList =  [MApi serverListWithMarket:market[i] permission:level[i]];
//        NSLog(@"IP地址列表%@",serverList);
//    }
    
//    NSArray *serverList =  [MApi serverListWithMarket:MApiMarketSH permission:MApiSourceLevel1];
//    NSLog(@"IP地址列表%@",serverList);
    
    //切换指定市场连接站点
//    [MApi resetServerList:serverList withMarket:MApiMarketSH permission:MApiSourceLevel2];
    
    
    //站点测速
//    MPingRequest *request = [[MPingRequest alloc] init];
//    request.URLString = serverList[0];
//    NSLog(@"%@",serverList[0]);
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status==MResponseStatusSuccess) {
//            MPingResponse *response = (MPingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSString   *items = response.IPAddress;
//            NSTimeInterval  Arrs = response.responseTime;
//            NSLog(@"IP地址：%@,响应时间：%f",items,Arrs);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"获取资讯源类别请求错误，错误信息是：%@",resp.message);
//        }
//
//    }];
    
    //练习:获取行情分类
//    MGetSourceClassRequest *request = [[MGetSourceClassRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status==MResponseStatusSuccess) {
//            MGetSourceClassResponse *response = (MGetSourceClassResponse *)resp;
//            //      NSDictionary * data=response.sourceClassInfos;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"获取行情分类请求错误，错误信息是：%@",resp.message);
//        }
//
//    }];
    
    //练习:获取主选单分类
//    MGetMenuRequest *request = [[MGetMenuRequest alloc] init];
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status==MResponseStatusSuccess) {
//            MGetMenuResponse *response = (MGetMenuResponse *)resp;
//            //            NSDictionary * data=response.sourceClassInfos;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"获取主选单分类请求错误，错误信息是：%@",resp.message);
//        }
//    
//    }];
    
    //练习:获取公告
//    MAnnouncementRequest *request = [[MAnnouncementRequest alloc] init];
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status==MResponseStatusSuccess) {
//            MAnnouncementResponse *response = (MAnnouncementResponse *)resp;
//            //            NSDictionary * data=response.sourceClassInfos;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"获取公告请求错误，错误信息是：%@",resp.message);
//        }
//    
//    }];
    
//    //练习:证券行情列表
////    //600000.sh,688001.sh,300182.sz,900907.sh,430021.bj,830821.bj,08153.hk,67934.hk,AUDUSD.gb,M00003.gb，KIC2006.cff,TF2009.cff,a2003.dce,c2005-C-2120.dce,ag2003.shfe,ru2001C14750.shfe,AP001.czce,CF003C13000.czce,nr2006.ine
//    MQuoteRequest *request = [[MQuoteRequest alloc] init];
////    request.code = @"603244.sh,603245.sh,603246.sh,603247.sh,603252.sh,603255.sh,603253.sh,600000.sh,000001.sz";
////    request.code = @"000001.sz,600000.sh,601399.sh,300816.sz,002943.sz,300343.sh,688036.sh,cu2105.shfe,pb2104.shfe,sc2105.ine,b2006.dce,ZC009.czce";
//    request.code = @"600519.sh,900905.sh,689009.sh,600900.sh,600809.sh,688200.sh,511310.sh,501064.sh,502006.sh,502003.sh,113041.sh,204182.sh,110044.sh,019545.sh,120602.sh,300760.sz,200581.sz,002985.sz,300841.sz,300869.sz,300661.sz,000538.sz,159972.sz,160133.sz,159001.sz,184801.sz,123013.sz,131802.sz,101528.sz,111073.sz,600702.sh,002192.sz,90000510.sz,10003182.sh";
//    //填入股票代码
//    request.stockFields = nil;
////      request.stockFields = @[@"openPrice",@"code",@"volume",@"amount",@"lowPrice",@"subtype",@"averageValue",@"preSettlement",@"openInterest",@"limitUp"];
////      request.stockFields = NULL;
////      request.addValueFields = @[@"ddz",@"largeSellCount",@"mediumDiffer"];
//    request.addValueFields = @[@"-1"];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MQuoteResponse *response = (MQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.stockItems;
////            NSLog(@"%@",response);
//            NSLog(@"站点：%@",request.ip);
////            NSLog(@"站****：%@",response.stockItems);
//            for (int i=0; i<item.count; i++) {
//                MStockItem *items = item[i];
////                NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@",items.datetime,item·s.ID,items.name,items.lastPrice,items.preClosePrice,items.capitalization,items.totalValue,items.circulatingShare,items.flowValue,items.receipts,items.PE,items.SPE);
////                NSLog(@"%@",items.openPrice,items.code,items.volume,items.amount,items.lowPrice,items.subtype,items.preSettlement);
//                NSLog(@"%@,%@",items.changeRate5,items.changeRate10);
//            }
//
////            BOOL hongKong = items.hongKong;
////            NSLog(@"%@",hongKong?@"YES":@"NO");
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"证券行情列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    NSArray *orry = @[@"688001.sh",@"688002.sh",@"688003.sh",@"688004.sh",@"688005.sh",@"688006.sh",@"688007.sh",@"688008.sh",@"300001.sz",@"300002.sz",@"300003.sz",@"300004.sz",@"300005.sz",@"300006.sz",@"300007.sz",@"300008.sz"];
//    for (int i=0;i<orry.count;i++){
//             练习:行情快照
//            MSnapQuoteRequest *request = [[MSnapQuoteRequest alloc] init];
//            request.code = @"603045.sh"; //填入股票代码
//            request.tickCount = 10;//明细条数
//        //    request.stockFields = @[@"buyPrices",@"sellPrices",@"lastPrice"];
//        //    request.stockFields = NULL;
//             request.addValueFields = @[@"-1"];
////            request.addValueFields = nil;
//
//            //发送请求
//            [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//                if (resp.status == MResponseStatusSuccess) {
//                    //应答无误，处理数据更新画面
//                    MSnapQuoteResponse *response = (MSnapQuoteResponse *)resp;
//                    NSDictionary * dic=[self getDictionaryFromObject_Ext:response.stockItem];
//                    self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//                    MStockItem *item = response.stockItem;
//        //            NSLog(@"%@,%@,%@,%@,%@,%@,%@,%ld,%ld,%ld,%ld,%ld",item.ID,item.name,item.securityStatus,item.buyQtyUpperLimit,item.sellQtyUpperLimit,item.marketBuyQtyUpperLimit,item.marketSellQtyUpperLimit,(long)item.REGFlag,(long)item.VIEFlag,(long)item.MFFlag,(long)item.RSLFFlag,(long)item.MMFFlag);
//        //            NSLog(@"~~~~%@,%@",item.afterHoursVolume,item.afterHoursAmount);
//        //            NSLog(@"%@",dic[@"tempActionRange_"]);
//                    NSLog(@"%@",item);
////                    NSLog(@"%@ , %@ , %@ , %@ , %@ , %@ , %@ , %@ , %@ , %@ ",orry[i],item.volume,item.circulatingShare,item.lastPrice,item.changeRate5,item.changeRate10,item.changeRate20,item.turnoverRate5,item.turnoverRate10,item.turnoverRate20);
//
////                    [_arrrr addObject:[NSString stringWithFormat:@"%@ , %@ , %@ , %@ , %@ ",orry[i],item.lastPrice,item.changeRate5,item.changeRate10,item.changeRate20]];
////                    [_arrrr addObject:[NSString stringWithFormat:@"%@ , %@ , %@ , %@ , %@ , %@ ",orry[i],item.volume,item.circulatingShare,item.turnoverRate5,item.turnoverRate10,item.turnoverRate20]];
////                    [_adiccc setValue:[NSString stringWithFormat:@"%@",item.addValueItem] forKey:[NSString stringWithFormat:@"%d",i]];
////                    [_adiccc setValue:[NSString stringWithFormat:@"%@ , %@ , %@ , %@ , %@ , %@ , %@ , %@ , %@ , %@ ",orry[i],item.volume,item.circulatingShare,item.lastPrice,item.changeRate5,item.changeRate10,item.changeRate20,item.turnoverRate5,item.turnoverRate10,item.turnoverRate20] forKey:[NSString stringWithFormat:@"%d",i]];
////                    [_adiccc setValue:[NSString stringWithFormat:@"%@,%@,%@,%@",orry[i],item.lastPrice,item.changeRate,item.change] forKey:[NSString stringWithFormat:@"%d",i]];
//        //            NSLog(@"%@,%@,%@,%@",item.ID,item.name,item.datetime,item.sellActionRange);
//
//        //            NSLog(@"\ndatetime:%@\nsecurityStatus：%@,\nbuyQtyUpperLimit：%@,\nsellQtyUpperLimit：%@,\nmarketBuyQtyUpperLimit：%@,\nmarketSellQtyUpperLimit：%@,\nbuyActionRange：%@,\nsellActionRange：%@,\nAFBuyQtyUpperLimit：%@,\nAFSellQtyUpperLimit：%@",item.datetime,item.securityStatus,item.buyQtyUpperLimit,item.sellQtyUpperLimit,item.marketBuyQtyUpperLimit,item.marketSellQtyUpperLimit,item.buyActionRange,item.sellActionRange,item.AFBuyQtyUpperLimit,item.AFSellQtyUpperLimit);
//        //            NSLog(@"市价申报数量上限:%@/市价申报数量下限:%@/限价申报数量上限:%@/限价申报数量下限:%@",item.subscribeLimit,item.subscribeLowerLimit,item.PLSubscribeLimit,item.PLSubscribeLowerLimit);
//                    //BOOL bond = item.bond;
//                    //NSLog(@"%@",bond?@"YES":@"NO");
//                } else {
//                    //应答错误，显示错误信息
//                    NSLog(@"回传代码：%ld",(long)resp.status);
//                    //NSLog(@"错误站点信息：%@",request.ip);
//                    NSLog(@"行情快照请求错误，错误信息是：%@",resp.message);
//                }
//            }];
//    }
//

////    要约申购接口
//    MOfferQuoteRequest *request = [[MOfferQuoteRequest alloc] init];
//    request.code = @"002668.sz"; //填入股票代码
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOfferQuoteResponse *response = (MOfferQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.items;
//            NSLog(@"%@",item);
//            for (int i=0; i<item.count; i++) {
//                MOfferItem *arr= item[i];
//                NSLog(@"%@,%@,%@,%@,%@,%@,%@",arr.code,arr.name,arr.offerID,arr.offerName,arr.price,arr.startDate,arr.endDate);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"回传代码：%ld",resp.status);
//            //NSLog(@"错误站点信息：%@",request.ip);
//            NSLog(@"行情快照请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    要约列表
//    MOfferQuoteListRequest *request =[[MOfferQuoteListRequest alloc] init];
//    request.pageIndex = 0; //第一页
//    request.pageSize = 1000;
//    request.ascending = NO;
//    request.field =  MOfferQuoteListEndDate; // 排序栏位
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOfferQuoteResponse *response = (MOfferQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.items;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",item);
//            for (int i=0; i<item.count; i++) {
//                MOfferItem *arr= item[i];
////                NSLog(@"%@,%@,%@,%@,%@,%@,%@",arr.code,arr.name,arr.offerID,arr.offerName,arr.price,arr.startDate,arr.endDate);
//                NSLog(@"%@",item);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"回传代码：%ld",(long)resp.status);
//            // NSLog(@"错误站点信息:%@",resp.request.ip);
//            NSLog(@"要约信息列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:AH联动
//    MAHQuoteRequest *request = [[MAHQuoteRequest alloc] init];
//    request.code = @"601618.sh"; //填入股票代码
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MAHQuoteResponse *response = (MAHQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"1=====:%@",response);
//            NSLog(@"%@",request.ip);
////            NSLog(@"%@,%@,%@,%@,%@",response.linkageCode,response.lastPrice,response.premiumRate,response.preClosePrice,response.changeRate);
//            NSLog(@"%@",response);
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"AH联动请求错误，错误信息是：%@",resp.message);
//        }
//    }];

    
////    练习:可转债溢价列表
//    MKZZQuoteListRequest *request = [[MKZZQuoteListRequest alloc] init];
//    request.pageIndex = 0;
//    request.pageSize = 1000;
////    request.beginIndex = 1;
////    request.endIndex = 55;
//    request.ascending = NO;
//    request.field = MKZZQuoteListFieldChangeRateKZZ;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MKZZQuoteListResponse *response = (MKZZQuoteListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1=====:%@",response);
//            NSArray *item = response.items;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MKZZQuoteItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"%@,%@,%@,%@,%@",response.linkageCode,response.lastPrice,response.premiumRate,response.preClosePrice,response.changeRate);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"可转债溢价列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:AH股列表
//    MAHQuoteListRequest *request = [[MAHQuoteListRequest alloc] init];
//    request.pageIndex = 0;
//    request.pageSize = 1000;
////    request.beginIndex = 1;
////    request.endIndex = 55;
//    request.ascending = NO;
//    request.field = MAHQuoteListFieldLastPriceA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MAHQuoteListResponse *response = (MAHQuoteListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1=====:%@",response);
//            NSArray *item = response.ahItems;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MAHQuoteItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"%@,%@,%@,%@,%@",response.linkageCode,response.lastPrice,response.premiumRate,response.preClosePrice,response.changeRate);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"AH股列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];

    //练习:沪伦通联动
//    MDRLinkRequest *request = [[MDRLinkRequest alloc] init];
//    request.code = @"601601.sh"; //填入股票代码
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MDRLinkResponse *response = (MDRLinkResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"1=====:%@",response);
////            NSLog(@"%@,%@,%@,%@,%@",response.linkageCode,response.lastPrice,response.premiumRate,response.preClosePrice,response.changeRate);
//            NSLog(@"%@",response);
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"沪伦通联动请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
////    练习:沪伦通列表
//    MDRQuoteListRequest *request = [[MDRQuoteListRequest alloc] init];
//    request.code = @"gdr";
//    request.pageIndex = 0;
//    request.pageSize = 100;
//    request.ascending = NO;
//    request.field = MDRQuoteListFieldChangeRate;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MDRQuoteListResponse *response = (MDRQuoteListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1=====:%@",response);
//            NSArray *item = response.items;
//            NSLog(@"%ld",item.count);
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MDRQuoteItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"%@,%@,%@,%@,%@",response.linkageCode,response.lastPrice,response.premiumRate,response.preClosePrice,response.changeRate);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"沪伦通列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
////    练习:历史分时走势数据
//    MHistoryChartRequest *request = [[MHistoryChartRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.date = @"20200225";
//    request.subtype= @"1001";
//
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MHistoryChartResponse *response = (MHistoryChartResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////          NSLog(@"1----:%@",response);
//            NSArray *item = response.OHLCItems;
//            NSLog(@"%zd",item.count);
//            for (int i=0; i<item.count; i++) {
//                MOHLCItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"时间：%@,最新价：%@,成交量：%@,参考价：%@,均价：%@",items.datetime,items.closePrice,items.tradeVolume,items.referencePrice,items.averagePrice);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"历史分时走势请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:UK市场行情
//    MUKQuoteRequest *request = [[MUKQuoteRequest alloc] init];
//    request.code = @"651020.uk"; //填入股票代码
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MUKQuoteResponse *response = (MUKQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"站点信息：%@",request.ip);
//            MUKItem *item = response.stockItems;
//            NSLog(@"%@",item);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"回传代码：%ld",resp.status);
//            //NSLog(@"错误站点信息：%@",request.ip);
//            NSLog(@"UK市场行情请求错误，错误信息是：%@",resp.message);
//        }
//    }];

    //练习:指数成分股及沪深市场涨跌平家数
//    MIndexUpdownsRequest *request = [[MIndexUpdownsRequest alloc] init];
//    request.code = @"SHSZBZ";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MIndexUpdownsResponse *response = (MIndexUpdownsResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//            NSLog(@"站点信息:%@",request.ip);
//            NSLog(@"%@",dic);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"指数成分股及沪深市场涨跌平家数请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:沪深当日涨跌统计数据
//    MMarketUpdownsRequest *request = [[MMarketUpdownsRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MMarketUpdownsResponse *response = (MMarketUpdownsResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//            NSLog(@"站点信息:%@",request.ip);
//            NSLog(@"%@",dic);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"沪深当日涨跌统计数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//练习:路演列表接口
//    MRoadShowRequest *request = [[MRoadShowRequest alloc] init];
//    request.stockID = @"";
//    request.param = @"0,100";
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MRoadShowResponse *response = (MRoadShowResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSArray *items = response.items;
////            NSArray *items = dic[@"items"];
////            NSLog(@"本次请求总条数:%@",response.roadShowCount);
////            for (int i=0;i<items.count;i++){
////                MRoadShowItem *item = items[i];
////                NSLog(@"%@",item);
////            }
//            NSLog(@"%@",dic);
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"路演列表接口请求错误，错误信息是：%@",resp.message);
//        }
//    }];
////
//    //练习:路演详情接口
//    MGetRoadshowDetailUrlRequest *request = [[MGetRoadshowDetailUrlRequest alloc] init];
//    request.ID = @"6164";
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MGetRoadshowDetailUrlResponse *response = (MGetRoadshowDetailUrlResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"URL: %@",response.detailUrl);
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"路演列表接口请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    当日或30日复盘涨跌
//    MCompoundUpdownsRequest *request = [[MCompoundUpdownsRequest alloc] init];
//    request.code = @"bz";
//    request.type = MCompoundUpdownsTypeOneDay;
////    request.time = @"202111121500";
//
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MCompoundUpdownsResponse *response = (MCompoundUpdownsResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"站点信息:%@",request.ip);
//            NSArray *items = response.items;
//            NSLog(@"%ld",items.count);
//            for (int i=0; i<items.count; i++) {
//                MUpdownsItem *item = items[i];
////                NSLog(@"时间：%@,上涨家数：%@,下跌家数%@,平盘家数：%@,停牌家数：%@,涨停家数：%@,跌停家数：%@,,区间涨跌家数：%@,一字涨停家数：%@,自然涨停家数：%@,五日平均涨停家数：%@",item.dateTime,item.riseCount,item.fallCount,item.flatCount,item.stopCount,item.riseLimitCount,item.fallLimitCount,item.riseFallRange,item.oneRiseLimitCount,item.natureRiseFallCount,item.fiveAverageLimitCount);
////                NSLog(@"时间：%@,涨停家数：%@,一字涨停家数：%@,自然涨停家数：%@",item.dateTime,item.riseLimitCount,item.oneRiseLimitCount,item.natureRiseFallCount);
//                NSLog(@"时间：%@",item.dateTime);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"沪深当日涨跌统计数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    //练习:板块排行
//    MSectionSortingRequest *request = [[MSectionSortingRequest alloc] init];
//    request.code = @"Notion"; //填入板块代码
////    request.pageIndex = 0;//起始页
////    request.pageSize = 10;
//    request.beginIndex = 0;
//    request.endIndex = 99;
//    request.ascending = NO;//是否肾虚
//    request.field = MSectionSortingFieldNowVolume;//填入排序栏位
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MSectionSortingResponse *response = (MSectionSortingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1----:%@",response);
//            NSLog(@"站点信息:%@",resp.request.ip);
//            NSArray *item = response.sectionSortingItems;
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//                MSectionSortingItem *items = item[i];
////                NSLog(@"%@",items.ID);
////            NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@,%@",items.ID,items.name,items.lastPrice,items.openPrice,items.highPrice,items.lowPrice,items.preClosePrice,items.change,items.changeRate,items.changeRate5,items.changeRate10,items.amount,items.volume,items.nowVolume,items.weightedChange,items.averageChange,items.flowValue,items.totalValue,items.orderRatio,items.entrustDiff,items.turnoverRate,items.amplitudeRate,items.riseRate,items.advanceAndDeclineCount,items.limitUpCount,items.limitDownCount,items.capitalInflow,items.capitalOutflow,items.netCapitalInflow,items.netCapitalInflow5,items.netCapitalInflow10,items.stockID,items.stockChange,items.stockChangeRate);
//                NSLog(@"名：%@,  第%u条数据",items.name,i+1);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"板块排行请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////        //板块指数行情快照
//    MPlateIndexQuoteRequest *request = [[MPlateIndexQuoteRequest alloc] init];
//    request.code = @"A20001.bk"; //填入股票代码
//    //request.plateIndexFields = @[@"bigVolumeB",@"blockChg"];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MPlateIndexQuoteResponse *response = (MPlateIndexQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"站点信息:%@",resp.request.ip);
//            NSArray *items = response.plateIndexItems;
//            MPlateIndexItem *item = items[0];
//            NSLog(@"%@",item);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"错误站点信息:%@",resp.request.ip);
//            NSLog(@"板块指数行情快照请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:板块行情请求类
//    MSectionQuoteRequest *request = [[MSectionQuoteRequest alloc] init];
//    request.code = @"00700.hk"; //填入板块代码
//    request.type = @"trade,area,notion";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MSectionQuoteResponse *response = (MSectionQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.sectionQuoteItems;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",request.ip);
//            for (int  i=0;i<item.count; i++) {
//                MSectionSortingItem *items = item[i];
////                NSLog(@"%@,%@,%@,%@,%@,%@,%@",items.ID,items.name,items.lastPrice,items.stockID,items.stockName,items.stockLastPrice,items.type);
//                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"板块行情请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    int temp1[] = {0,1,2,7,8,9,10,11,12,13,14,15,19,20,21,24,25,26,27,28,29,30,31,32,37,38,42,53,54,57,58,86,87,88,89,-19,-20,-21,-22,-34,-35,-36,-37,-38,-39,-40,-41,-42,-47,-48,-58,-59,-60,-61,-62,-63};
//    NSArray *temp2 = @[@"status",@"ID",@"name",@"lastPrice",@"highPrice",@"lowPrice",@"openPrice",@"preClosePrice",@"changeRate",@"volume",@"nowVolume",@"turnoverRate",@"change",@"amount",@"volumeRatio",@"buyVolume",@"sellVolume",@"totalValue",@"flowValue",@"netAsset",@"PE",@"ROE",@"capitalization",@"circulatingShare",@"amplitudeRate",@"receipts",@"SPE",@"orderRatio",@"entrustDiff",@"DRCurrentShare",@"DRPreviousClosingShare",@"monthChangeRate",@"yearChangeRate",@"nMonthChangeRate",@"nYearChangeRate",@"ultraLargeNetInflow",@"largeNetInflow",@"mediumNetInflow",@"smallNetInflow",@"bbd",@"bbd5",@"bbd10",@"ddx",@"ddx5",@"ddx10",@"ddy",@"ddy5",@"ddy10",@"netCapitalInflow",@"fiveMinRise",@"netInflow5",@"netInflow10",@"netInflow20",@"netInflowRate5",@"netInflowRate10",@"netInflowRate20"];
//    NSArray *temp3 = @[@"HSCCI.hk",@"HSCEI.hk",@"HSC.hk",@"HSI.hk",@"HSP.hk",@"HSF.hk",@"HSU.hk"
//];
//    for (int iii = 0;iii<temp3.count;iii++){
//    for (int io = 0;io<temp2.count;io++){
////    练习:
    ///
    ///排行
////    NSArray *orry = @[@"SH1001",@"SH1002",@"SH1520",@"SH1540",@"SH1005",@"SH1006",@"SH1100",@"SH1110",@"SH1120",@"SH1130",@"SH1300",@"SH1311",@"SH1312",@"SH1313",@"SH1314",@"SZ1001",@"SZ1002",@"SZ1003",@"SZ1004",@"SZ10041",@"SZ10042",@"SZ1005",@"SZ1100",@"SZ1110",@"SZ1120",@"SZ1140",@"SZ1300",@"SZ1311",@"SZ1313",@"SZ1314",@"SHS",@"SZS"];
////        for (int i=0;i<orry.count;i++){
//    MCategorySortingRequest *request =[[MCategorySortingRequest alloc] init];
//    request.code = temp3[iii]; //分类代码
//    request.pageIndex = 0; //起始页码
//    request.pageSize = 10000;//每页多少条
////    request.beginIndex = 1;
////    request.endIndex = 50;
//    request.ascending = YES;//是否升序
//    request.field = temp1[io]; // 排序栏位
////    request.CFFSortingField = MCategoryCFFSortingFieldID; // 中金所排序栏位
//    request.includeSuspension = YES;//是否包含停牌股
////    request.stockFields = @[@"name",@"sellVolume"];
//    request.stockFields = nil;//快照自定义
//    request.addValueFields = @[@"-1"];//增值指标自定义
////    request.addValueFields = nil;//增值指标自定义
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        NSString *string;
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//
//            MCategorySortingResponse *response = (MCategorySortingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *items = response.stockItems;
//            NSLog(@"%@",request.ip);
//            string = [items componentsJoinedByString:@","];
////            NSLog(@"%@",response);
////            NSLog(@"有用信息- %@-%lu",request.code,(unsigned long)item.count);
////            NSLog(@"排序字段zong:%@",temp2[io]);
//            for (int i=0; i<items.count; i++) {
//                MStockItem *item = items[i];
////                NSLog(@"%@,%@,%@,%lu,%@,%@,%@,%@,%@,%@,%ld",items.ID,items.name,items.amount,(unsigned long)items.changeState,items.highPrice,items.lastPrice,items.totalValue,items.flowValue,items.PE,items.SPE,(long)items.status);
////                NSLog(@"我是一个粉刷匠：%@,  粉刷本领强：%@,  已经刷完%d面墙，刷呀刷的棒",items.name,items.ID,i+1);
//                NSString *str = @"jj";
//                if (item.changeState == 1){
//                    str = @"+";
//                }else if (item.changeState == 2){
//                    str = @"-";
//                }
//                NSLog(@"*有用信息- %@ 排序字段: %@: %@ %@",temp3[iii],temp2[io],str,[item valueForKey:temp2[io]]);
////                NSLog(@"%lu %@",(unsigned long)items.changeState,items.changeRate);
////                NSLog(@"%@ // %@",request.ip,items.addValueItem.ultraLargeNetInflow);
////                [_adiccc setValue:[NSString stringWithFormat:@"%@",item.addValueItem] forKey:[NSString stringWithFormat:@"%d",i]];
//            }
//            NSLog(@"*有用信息-");
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"回传代码：%ld,错误参数：%@",(long)resp.status,request.code);
//          //NSLog(@"错误站点信息:%@",resp.request.ip);
//            NSLog(@"分类排行请求错误，错误信息是：%@",resp.message);
//        }
////        UILabel *label = [[UILabel alloc] init];
////        label.frame = self.view.bounds;
////        label.backgroundColor = [UIColor greenColor];
////        label.textColor = [UIColor blueColor];
////        label.text = string;
////        label.numberOfLines = 0;
////        [self.view addSubview:label];
//    }];
////
//    }
//    }
    
//    //    练习:分类排行
//        MCategorySortingRequest *request =[[MCategorySortingRequest alloc] init];
//        request.code = @"BZ1001"; //分类代码
//        request.pageIndex = 0; //起始页码
//        request.pageSize = 5000;//每页多少条
//    //    request.beginIndex = 1;
//    //    request.endIndex = 50;
//        request.ascending = YES;//是否升序
//        request.field = MCategorySortingFieldID; // 排序栏位
//    //    request.CFFSortingField = MCategoryCFFSortingFieldID; // 中金所排序栏位
//        request.includeSuspension = YES;//是否包含停牌股
//    //    request.stockFields = @[@"name",@"sellVolume"];
//        request.stockFields = nil;//快照自定义
////        request.addValueFields = @[@"-63"];//增值指标自定义
//        request.addValueFields = nil;//增值指标自定义
//
//        //发送请求
//        [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//            NSString *string;
//            if (resp.status == MResponseStatusSuccess) {
//                //应答无误，处理数据更新画面
//
//                MCategorySortingResponse *response = (MCategorySortingResponse *)resp;
//                NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//                NSArray *item = response.stockItems;
//                string = [item componentsJoinedByString:@","];
//    //            NSLog(@"%@",response);
////                NSLog(@"有用信息- %@-%lu",request.code,(unsigned long)item.count);
//                NSLog(@"排序字段zong:%@",request.ip);
//                for (int i=0; i<item.count; i++) {
//                    MStockItem *items = item[i];
////                    NSLog(@"%@,%@,%@,%lu,%@,%@,%@,%@,%@,%@,%ld",items.ID,items.name,items.volume,(unsigned long)items.changeState,items.highPrice,items.lastPrice,items.totalValue,items.flowValue,items.PE,items.SPE,(long)items.status);
//    //                NSLog(@"我是一个粉刷匠：%@,  粉刷本领强：%@,  已经刷完%d面墙，刷呀刷的棒",items.name,items.ID,i+1);
////                    NSLog(@"有用信息- 排序字段: %@ %@",temp2[io],[items valueForKey:temp2[io]]);
////                    NSLog(@"%@,10日涨跌：%@,5日涨跌：%@,20日涨跌：%@,5日换手：%@,10日换手：%@,20日换手：%@",items.ID,items.changeRate10,items.changeRate5,items.changeRate20,items.turnoverRate5,items.turnoverRate10,items.turnoverRate20);
//                    NSLog(@"%@,%@",items.code,items.ROE);
//                }
//            } else {
//                //应答错误，显示错误信息
//                NSLog(@"回传代码：%ld,错误参数：%@",(long)resp.status,request.code);
//              //NSLog(@"错误站点信息:%@",resp.request.ip);
//                NSLog(@"分类排行请求错误，错误信息是：%@",resp.message);
//            }
//        }];
//        int temp1[] = {0,1,2,7,8,9,10,11,12,13,14,15,19,20,21,24,25,26,27,28,29,30,31,32,37,38,42,53,54,57,58,86,87,88,89,98,99,100,101,102,103,104,105,106,107,108,-19,-20,-21,-22,-34,-35,-36,-37,-38,-39,-40,-41,-42,-47,-48,-58,-59,-60,-61,-62,-63};
//        NSArray *temp2 = @[@"status",@"ID",@"name",@"lastPrice",@"highPrice",@"lowPrice",@"openPrice",@"preClosePrice",@"changeRate",@"volume",@"nowVolume",@"turnoverRate",@"change",@"amount",@"volumeRatio",@"buyVolume",@"sellVolume",@"totalValue",@"flowValue",@"netAsset",@"PE",@"ROE",@"capitalization",@"circulatingShare",@"amplitudeRate",@"receipts",@"SPE",@"orderRatio",@"entrustDiff",@"DRCurrentShare",@"DRPreviousClosingShare",@"monthChangeRate",@"yearChangeRate",@"nMonthChangeRate",@"nYearChangeRate",@"TTM",@"PBR",@"buyVolume1",@"sellVolume1",@"listingDate",@"changeRate5",@"ChangeRate10",@"changeRate10",@"turnoverRate5",@"turnoverRate10",@"turnoverRate20",@"ultraLargeNetInflow",@"largeNetInflow",@"mediumNetInflow",@"smallNetInflow",@"bbd",@"bbd5",@"bbd10",@"ddx",@"ddx5",@"ddx10",@"ddy",@"ddy5",@"ddy10",@"netCapitalInflow",@"fiveMinRise",@"netInflow5",@"netInflow10",@"netInflow20",@"netInflowRate5",@"netInflowRate10",@"netInflowRate20"];
    
//        int temp1[] = {-19,-20,-21,-22,-34,-35,-36,-37,-38,-39,-40,-41,-42,-47,-48,-58,-59,-60,-61,-62,-63};
//        NSArray *temp2 = @[@"ultraLargeNetInflow",@"largeNetInflow",@"mediumNetInflow",@"smallNetInflow",@"bbd",@"bbd5",@"bbd10",@"ddx",@"ddx5",@"ddx10",@"ddy",@"ddy5",@"ddy10",@"netCapitalInflow",@"fiveMinRise",@"netInflow5",@"netInflow10",@"netInflow20",@"netInflowRate5",@"netInflowRate10",@"netInflowRate20"];
    
        int temp1[] = {0,1,2,7,8,9,10,11,12,13,14,15,19,20,21,24,25,26,27,28,29,30,31,32,37,38,42,53,54,57,58,86,87,88,89,98,99,100,101,102,103,104,105,106,107,108};
        NSArray *temp2 = @[@"status",@"ID",@"name",@"lastPrice",@"highPrice",@"lowPrice",@"openPrice",@"preClosePrice",@"changeRate",@"volume",@"nowVolume",@"turnoverRate",@"change",@"amount",@"volumeRatio",@"buyVolume",@"sellVolume",@"totalValue",@"flowValue",@"netAsset",@"PE",@"ROE",@"capitalization",@"circulatingShare",@"amplitudeRate",@"receipts",@"SPE",@"orderRatio",@"entrustDiff",@"DRCurrentShare",@"DRPreviousClosingShare",@"monthChangeRate",@"yearChangeRate",@"nMonthChangeRate",@"nYearChangeRate",@"TTM",@"PBR",@"buyVolume1",@"sellVolume1",@"listingDate",@"changeRate5",@"ChangeRate10",@"changeRate20",@"turnoverRate5",@"turnoverRate10",@"turnoverRate20"];

        NSArray *temp3 = @[@"SH1000",@"SH1001",@"SH1002",@"SH1005",@"SH1006",@"SH1011",@"SH1100",@"SH1110",@"SH1120",@"SH1130",@"SH1133",@"SH1150",@"SH1300",@"SH1311",@"SH1312",@"SH1313",@"SH1314",@"SH1400",@"SH1540",@"SH3002",@"SH9002",@"SHS",@"SHSZS",@"SZ1000",@"SZ1001",@"SZ1002",@"SZ1004",@"SZ10041",@"SZ10042",@"SZ1005",@"SZ1011",@"SZ1100",@"SZ1110",@"SZ1120",@"SZ1130",@"SZ1150",@"SZ1300",@"SZ1311",@"SZ1312",@"SZ1313",@"SZ1314",@"SZ1400",@"SZ1410",@"UK1540",@"SZ3002",@"SZ9800",@"SZ9900",@"SZS"];
        for (int iii = 0;iii<temp3.count;iii++){
        for (int io = 0;io<temp2.count;io++){
    //    练习:分类排行
        MCategorySortingRequest *request =[[MCategorySortingRequest alloc] init];
        request.code = temp3[iii]; //分类代码
        request.pageIndex = 0; //起始页码
        request.pageSize = 100;//每页多少条
    //    request.beginIndex = 1;
    //    request.endIndex = 50;
        request.ascending = YES;//是否升序
        request.field = temp1[io]; // 排序栏位
    //    request.CFFSortingField = MCategoryCFFSortingFieldID; // 中金所排序栏位
        request.includeSuspension = YES;//是否包含停牌股
    //    request.stockFields = @[@"name",@"sellVolume"];
        request.stockFields = nil;//快照自定义
        request.addValueFields = @[@"-1"];//增值指标自定义
    //    request.addValueFields = nil;//增值指标自定义

        //发送请求
        [MApi sendRequest:request completionHandler:^(MResponse *resp) {
            NSString *string;
            if (resp.status == MResponseStatusSuccess) {
                //应答无误，处理数据更新画面

                MCategorySortingResponse *response = (MCategorySortingResponse *)resp;
                NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
                self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
                NSArray *items = response.stockItems;
                NSLog(@"ioiuio%@,%@,%@,%lu",request.ip,temp2[io],temp3[iii],(unsigned long)items.count);
                string = [items componentsJoinedByString:@","];
                
    //            NSLog(@"%@",response);
    //            NSLog(@"有用信息- %@-%lu",request.code,(unsigned long)item.count);
    //            NSLog(@"排序字段zong:%@",temp2[io]);
                
                NSString *lastValue;
                for (int i=0; i<items.count; i++) {
                    MStockItem *item = items[i];
                    MAddValueItem *add = item.addValueItem;
                    //换
                    NSString *value = [item valueForKey:temp2[io]];
                    
                    
                    if([temp2[io]  isEqual: @"change"]|[temp2[io]  isEqual: @"changeRate"]){
                        if (item.changeState == 2){
                            value = [NSString stringWithFormat:@"-%@",[item valueForKey:temp2[io]]];
                        }
                        
                    }
                    NSString *boo = @"true";
                    if (i != 0){
                        if(request.ascending == NO){
//                            NSLog(@"zhubaoping:%f,%f",value.doubleValue,lastValue.doubleValue);
                            if (value.doubleValue <= lastValue.doubleValue){
                                boo = @"true";
                            }else{
                                boo = @"false";
                            }
                        }else{
//                            NSLog(@"zhubaoping:%f,%f",value.doubleValue,lastValue.doubleValue);
                            if (value.doubleValue < lastValue.doubleValue){
                                boo = @"false";
                            }else{
                                boo = @"true";
                            }
                        }
                    }
                    lastValue = value;
    //                NSLog(@"%@,%@,%@,%lu,%@,%@,%@,%@,%@,%@,%ld",items.ID,items.name,items.amount,(unsigned long)items.changeState,items.highPrice,items.lastPrice,items.totalValue,items.flowValue,items.PE,items.SPE,(long)items.status);
    //                NSLog(@"我是一个粉刷匠：%@,  粉刷本领强：%@,  已经刷完%d面墙，刷呀刷的棒",items.name,items.ID,i+1);
                    NSLog(@"有用信息/代码：%@,状态:(%ld%ld),排序字段:%@(%ld),%@,判断: %@",item.code,(long)item.status,(long)item.stage,temp2[io],(long)request.field,value,boo);
                    
                    
    //                NSLog(@"%lu %@",(unsigned long)items.changeState,items.changeRate);
    //                NSLog(@"%@ // %@",request.ip,items.addValueItem.ultraLargeNetInflow);
    //                [_adiccc setValue:[NSString stringWithFormat:@"%@",item.addValueItem] forKey:[NSString stringWithFormat:@"%d",i]];
                }
            } else {
                //应答错误，显示错误信息
                NSLog(@"回传代码：%ld,错误参数：%@,%ld",(long)resp.status,request.code,(long)request.field);
              //NSLog(@"错误站点信息:%@",resp.request.ip);
                NSLog(@"分类排行请求错误，错误信息是：%@",resp.message);
            }
    //        UILabel *label = [[UILabel alloc] init];
    //        label.frame = self.view.bounds;
    //        label.backgroundColor = [UIColor greenColor];
    //        label.textColor = [UIColor blueColor];
    //        label.text = string;
    //        label.numberOfLines = 0;
    //        [self.view addSubview:label];
        }];
    //        [NSThread sleepForTimeInterval:3];
    //
        }
        }
    
    
    
    
    
//    NSArray *orry = @[@"688358.sh",@"688215.sh",@"688369.sh",@"688229.sh",@"688188.sh",@"688338.sh",@"688060.sh",@"688095.sh",@"688301.sh",@"688557.sh",@"688309.sh",@"688577.sh",@"688004.sh",@"688217.sh",@"688059.sh",@"688058.sh",@"688360.sh",@"688606.sh",@"688536.sh",@"688169.sh",@"688600.sh",@"688021.sh",@"688393.sh",@"688665.sh",@"688013.sh",@"688617.sh",@"688083.sh",@"688310.sh",@"688368.sh",@"688289.sh",@"688500.sh",@"688377.sh",@"688092.sh",@"688466.sh",@"688621.sh",@"688051.sh",@"688566.sh",@"688109.sh",@"688569.sh",@"688555.sh",@"688269.sh",@"688198.sh",@"688681.sh",@"688618.sh",@"688528.sh",@"688677.sh",@"688156.sh",@"688550.sh",@"688200.sh",@"688378.sh",@"688178.sh",@"688339.sh",@"688157.sh",@"688133.sh",@"688379.sh",@"688117.sh",@"688789.sh",@"688228.sh",@"688314.sh",@"688069.sh",@"688057.sh",@"688096.sh",@"688399.sh",@"688386.sh",@"688196.sh",@"688513.sh",@"688316.sh",@"688656.sh",@"688679.sh",@"688026.sh",@"688607.sh",@"688318.sh",@"688639.sh",@"688067.sh",@"688312.sh",@"688155.sh",@"688160.sh",@"688308.sh",@"688131.sh",@"688408.sh",@"688330.sh",@"688696.sh",@"688168.sh",@"688020.sh",@"688636.sh",@"688398.sh",@"688202.sh",@"688682.sh",@"688278.sh",@"688793.sh",@"688356.sh",@"688189.sh",@"688276.sh",@"688687.sh",@"688286.sh",@"688686.sh",@"688118.sh",@"688029.sh",@"688056.sh",@"688027.sh"
//];
//    NSArray *orry1 = @[@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006",@"1006"];
//        for (int i=0;i<orry.count;i++){
////      集合竞价走势数据
//    MBidChartRequest *request = [[MBidChartRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.subtype= @"1001";
//    NSLog(@"%@",request.ip);
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBidChartResponse *response = (MBidChartResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"%@",response);
//            NSArray *item = response.bidItems;
//            NSLog(@"%lu",item.count);
//            for (int ii=0; ii<item.count; ii++) {
//                MBidItem *items = item[ii];
//
//                NSLog(@"code:%@,%@,%@,%@,%@,%@,%@,%@",request.code,items.datetime,items.lastPrice,items.referencePrice,items.buyVolume1,items.buyVolume2,items.sellVolume1,items.sellVolume2);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"走势数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//        }
    
////    练习:AB股列表
//    MABQuoteListRequest *request = [[MABQuoteListRequest alloc] init];
//    request.pageIndex = 0;
//    request.pageSize = 1000;
////    request.beginIndex = 1;
////    request.endIndex = 55;
//    request.ascending = NO;
//    request.field = MABQuoteListFieldChangeCodeA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MABQuoteListResponse *response = (MABQuoteListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1=====:%@",response);
//            NSArray *item = response.items;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MABLinkItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"%@,%@,%@,%@,%@",response.linkageCode,response.lastPrice,response.premiumRate,response.preClosePrice,response.changeRate);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"AH股列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    //AB股联动
//    MABQuoteRequet *request =[[MABQuoteRequet alloc] init];
//    request.code = @"600618.sh"; //填入股票代码
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if(resp.status == MResponseStatusSuccess) {
//            MABQuoteResponse *response = (MABQuoteResponse *)resp;
//            NSLog(@"losado:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"行情快照错误信息是：%@",resp.message);
//        }}];
    
////    练习:走势数据
//    MChartRequest *request = [[MChartRequest alloc] init];
//    request.code = @"67539.hk"; //填入股票代码
//    request.subtype= @"1500";
//    request.chartType = MChartTypeFiveDays;//走势类别
//        request.returnAFData= YES;//是否返回盘后交易数据
////        request.superpositionCode = @"600004.sh";//叠加项
////    request.superpositionSubtype = @"1001";
//
//    //    发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp23) {
//        if (resp23.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MChartResponse *response = (MChartResponse *)resp23;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.OHLCItems;
//            NSLog(@"%lu",(unsigned long)item.count);
//            for (int i=0; i<item.count; i++) {
//                MOHLCItem *items = item[i];
////                NSLog(@"start:%d//%@ %@",i,items.datetime,items);
////                NSLog(@"%@,%@,%@,%@,%@",items.datetime,items.closePrice,items.tradeVolume,items.referencePrice,items.averagePrice);
//                NSLog(@"%@,%@,%@",request.ip,items.datetime,items.averagePrice);
////                NSLog(@"时间：%@,最新价：%@,成交量：%@,参考价：%@,均价：%@,持仓量：%@",items.datetime,items.closePrice,items.tradeVolume,items.referencePrice,items.averagePrice,items.openInterest);IOPV
////                NSLog(@"时间：%@,收盘价：%@,均价：%@,参考价：%@,成交量：%@,成交额：%@",items.datetime,items.closePrice,items.averagePrice,items.referencePrice,items.tradeVolume,items.amount);
////                NSLog(@"%@",response.AFItems);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"走势数据请求错误，错误信息是：%@",resp23.message);
//        }
//    }];

////    盘后走势数据
//    MAfterHoursChartRequest *request = [[MAfterHoursChartRequest alloc] init];
//    request.code = @"302008.sz"; //填入股票代码
//    request.subtype= @"1004";
//
//
////    发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MAfterHoursChartResponse *response = (MAfterHoursChartResponse *)resp;
////            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
////            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"%@",response);
//            NSArray *item = response.OHLCItems;
//            int i= 0;
//            for (i=0; i<item.count; i++) {
//                MOHLCItem *items = item[i];
//                NSLog(@"%@,%@,%@,%@,%@",items.datetime,items.closePrice,items.tradeVolume,items.referencePrice,items.averagePrice);
////                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"走势数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    //练习:分时走势指标数据
//    MChartIndexRequest *request = [[MChartIndexRequest alloc] init];
//    request.code = @"600519.sh"; //填入股票代码
//    request.type = MChartIndexTypeBBD |  MChartIndexTypeDDX;
//    request.beginIndex = 0;
//    request.endIndex = 200;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MChartIndexResponse *response = (MChartIndexResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"站点信息:%@",request.ip);
//            NSArray *item = response.OHLCItems;
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//            MOHLCItem *items = item[i];
//            NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分时走势指标数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:K线数据
//    MOHLCRequest *request = [[MOHLCRequest alloc] init];
//    request.code = @"430277.bj"; //填入股票代码
//    request.subtype= @"1000";
////    request.count = 500;
//    request.period = MOHLCPeriodMonth; //K线周期
//    request.priceAdjustedMode = MOHLCPriceAdjustedModeNone; //复权模式
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOHLCResponse *response = (MOHLCResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1----:%@",response);
//            NSArray *item = response.OHLCItems;
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//                MOHLCItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"%@,%@,%@",items.datetime,items.tradeVolume,items.amount);
////                NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@",items.datetime,items.openPrice,items.highPrice,items.lowPrice,items.closePrice,items.referencePrice,items.tradeVolume,items.amount);
////            NSLog(@"时间:%@,开盘价:%@,最高价:%@,最低价:%@,收盘价:%@,参考价:%@,成交量:%@,成交额:%@,均价:%@,盘后成交量:%@,盘后成交额:%@",items.datetime,items.openPrice,items.highPrice,items.lowPrice,items.closePrice,items.referencePrice,items.tradeVolume,items.amount,items.averagePrice,items.afterHoursVolume,items.afterHoursAmount);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"K线数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//    NSArray *orry = @[@"T2112.cff",@"TS2109.cff",@"TF2109.cff"];
//    NSArray *subts = @[@"futureT",@"futureTS",@"futureTF"];
////    [_arrrr addObject:[NSString stringWithFormat:@"1分k，不赋权"]];
//    __block int iw = 0;
//    for(int i=0;i<orry.count;i++){
//    //练习:历史K线数据
//    MOHLCRequestV2 *request = [[MOHLCRequestV2 alloc] init];
//    request.code = @"872925.bz"; //填入股票代码
//    request.subtype= @"1000";
//    request.period = MOHLCPeriodDay; //K线周期
////    request.count = 100;
////    request.date = @"20210617170000";
//    request.requestType = MRequestTypeRecent; //按日期获取规则
//    request.priceAdjustedMode = MOHLCPriceAdjustedModeForward; //复权模式
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOHLCResponse *response = (MOHLCResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"复权信息:%@",response.FQItems);
//            NSArray *items = response.OHLCItems;
////            NSLog(@"%zd",items.count);
////            NSLog(@"%@",request.ip);
////            MOHLCItem *item = items[0];
////            NSLog(@"%@,%f",item.averagePrice,item.amount.doubleValue/item.tradeVolume.doubleValue);
////            [_arrrr addObject:orry[i]];
////            [_arrrr addObject:[NSString stringWithFormat:@"%@, %f      ,%@",item.averagePrice,item.amount.doubleValue/item.tradeVolume.doubleValue,request.code]];
//            for (int ii=0; ii<items.count; ii++) {
//                MOHLCItem *item = items[ii];
////        NSLog(@"第%d条数据，时间：%@,开盘价：%@,最高价：%@,最低价：%@,收盘价：%@,基金净值：%@,\n 参考价:%@,成交量:%@,成交额:%@,均价:%@,盘后成交量:%@,盘后成交额:%@",i,items.datetime,items.openPrice,items.highPrice,items.lowPrice,items.closePrice,items.IOPV,items.referencePrice,items.tradeVolume,items.amount,items.averagePrice,items.afterHoursVolume,items.afterHoursAmount);
////                NSLog(@"%d  时间：%@,开盘价：%@,最高价：%@,最低价：%@,收盘价：%@,基金净值：%@",i,items.datetime,items.openPrice,items.highPrice,items.lowPrice,items.closePrice,items.IOPV);
//////                NSLog(@"站点：%@//:%d //:%@",request.ip,i,items.datetime);
////                NSLog(@"%@,%@,开：%@,高：%@,低：%@,收:%@,量:%@,参考价：%@,额：%@,均价：%@",request.code,item.datetime,item.openPrice,item.highPrice,item.lowPrice,item.closePrice,item.tradeVolume,item.referencePrice,item.amount,item.averagePrice);
//                NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@,%@",item.datetime,item.openPrice,item.highPrice,item.lowPrice,item.closePrice,item.tradeVolume,item.referencePrice,item.amount,item.averagePrice);
////                NSLog(@"%@",item);
////                NSLog(@"%@,%@,%@",orry[i],item.datetime,item.averagePrice);
////                NSLog(@"iw= %D",iw);
////                [_adiccc setValue:[NSString stringWithFormat:@"%@,%@,%@",orry[i],item.datetime,item.averagePrice] forKey:[NSString stringWithFormat:@"%d",iw]];
////                iw = iw+1;
//                }
//
////            NSArray *arr= response.FQItems;
////            NSLog(@"%@",arr);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"历史K线数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//    }
    //练习:经纪席位
//    MBrokerSeatRequest *request = [[MBrokerSeatRequest alloc] init];
//    request.code = @"651021.sh";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBrokerSeatResponse *response = (MBrokerSeatResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
////            NSArray *item = response.buyBrokerSeatItems;
////            int i=0;
////            for (i=0; i<100; i++) {
////                MBrokerSeatItem *items = item[i];
////                NSLog(@"%@",items);
////            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"经纪席位请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    //练习:股票查询-本地搜索（下载分市场股票代码表）
//    UIAlertView *_alertView = [[UIAlertView alloc] initWithTitle:@"提 示" message:[NSString stringWithFormat:@"\n正在下载最新股票代码表 请稍候···"] delegate:nil cancelButtonTitle:@"返回" otherButtonTitles:nil];
//    [_alertView show];
//
//    [MApi downloadStockTableWithMarkets:@[@"bj"] completionHandler:^(NSError *error)  {
////        @"sh",@"sz",@"cff",@"bj",@"hk",@"hh",@"hz",@"czce",@"dce",@"ine",@"shfe",@"fe",@"gb",@"gi",@"uk",
//        if (!error) {
//            sleep(10);
//            [_alertView dismissWithClickedButtonIndex:1 animated:YES];//提示框消失
//            MSearchRequest *request = [[MSearchRequest alloc] init];
//            request.keyword = @"871090"; //设定关键字
//            request.categories = @[@"sh"];
////            request.searchLimit = 20;
//            request.searchLocal = NO;
//            request.returnRenamed = YES;
//            request.returnDelisted = YES;
//
//            //发送请求
//            [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//                if (resp.status == MResponseStatusSuccess) {
//                    //应答无误，处理数据更新画面
//                    MSearchResponse *response = (MSearchResponse *)resp;
//                    NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                    self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////                    NSLog(@"%@",response);
//                    NSArray *item = response.resultItems;
//                    //NSString *cachesPaths = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
//                    NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
//                    NSLog(@"documentsPath:%@",documentsPath);
//                    NSLog(@"%lu",(unsigned long)item.count);
//                    for (int i=0; i<item.count; i++) {
//                        MSearchResultItem * items = item[i];
////                        NSLog(@"%@",items);
//                        NSLog(@"%@,%@,%@,%@,%@,%@,%@,%@",items.code,items.stockID,items.name,items.market,items.subtype,items.pinyin,items.subtype,items.subtypes);
//                    }
//                } else {
//                    //应答错误，显示错误信息
//                    NSLog(@"股票查询请求错误，错误信息是：%@",resp.message);
//                }
//            }];
//        }else{ _alertView.message=@"下载失败 点击返回";
//        }
//    }];

//    练习:查看分市场股票代码表
//    UIAlertView *_alertView = [[UIAlertView alloc] initWithTitle:@"提 示" message:[NSString stringWithFormat:@"\n正在下载最新股票代码表 请稍候···"] delegate:nil cancelButtonTitle:@"返回" otherButtonTitles:nil];
//    [_alertView show];
//    [MApi downloadStockTableWithMarkets:@[@"sh"] completionHandler:^(NSError *error)  {
//        if (!error) {
//            sleep(10);
//            [_alertView dismissWithClickedButtonIndex:1 animated:YES];//提示框消失
//            MStockTableRequest *request = [[MStockTableRequest alloc] init];
//            //发送请求
//            [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//                if (resp.status == MResponseStatusSuccess) {
//                    //应答无误，处理数据更新画面
//                    MStockTableResponse *response = (MStockTableResponse *)resp;
//                    NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                    self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////                    NSLog(@"1----:%@",response);
////                    NSString *cachesPaths = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
////                    NSLog(@"cachesPaths:%@",cachesPaths);
//                    NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
//                    NSLog(@"documentsPath:%@",documentsPath);
//                    NSArray *item = response.resultItems;
//                    int i = 0;
//                    for (i=0; i<item.count; i++) {
//                    MSearchResultItem *items = item[i];
//                    NSLog(@"%@",items);
//                    }
//                } else {
//                    //应答错误，显示错误信息
//                    NSLog(@"股票查询请求错误，错误信息是：%@",resp.message);
//                }
//            }];
//        }else{ _alertView.message=@"下载失败 点击返回";
//        }
//    }];
//
////    //练习:股票查询-网络搜索
//    MSearchRequest *request = [[MSearchRequest alloc] init];
//    request.keyword = @"889901.bj"; //设定关键字
//    request.categories = @[@"bj"];
//    request.searchLocal = NO;
//    request.searchLimit = 10000;
//    request.returnRenamed = YES;
//    request.returnDelisted = YES;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MSearchResponse *response = (MSearchResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"1----:%@",response);
//            NSArray *item = response.resultItems;
//            NSLog(@"%@",request.ip);
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//                MSearchResultItem *items = item[i];
//                NSLog(@"代码:%@,%@,%@,%@,%@,%@,股票代码:%@,标签:%ld",items.code,items.name,items.market,items.subtype,items.pinyin,items.subtypes,items.stockID,(long)items.flag);
////                NSLog(@"%@,%@",items.stockID,items.name);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"股票查询请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//        //练习:股票查询2-网络搜索
//        MSearchRequestV2 *request = [[MSearchRequestV2 alloc] init];
//        request.keyword = @"18"; //设定关键字
//        request.categories = @[@"BZ1001",@"HKSGT"];
//        request.searchLimit = 1000;
//
//        //发送请求
//        [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//            if (resp.status == MResponseStatusSuccess) {
//                //应答无误，处理数据更新画面
//                MSearchResponse *response = (MSearchResponse *)resp;
//                NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//                //NSLog(@"1----:%@",response);
//                NSArray *item = response.resultItems;
//                NSLog(@"%ld",item.count);
//                for (int i=0; i<item.count; i++) {
//                    MSearchResultItem *items = item[i];
////                    NSLog(@"%@,%@,%@,%@,%@",items.code,items.name,items.market,items.subtype,items.subtypes);
////                    NSLog(@"%@,%@",items.code,items.market);
//                    NSLog(@"代码:%@,%@,%@,%@,%@,%@,股票代码:%@,标签:%ld",items.code,items.name,items.market,items.subtype,items.pinyin,items.subtypes,items.stockID,(long)items.flag);
//                    ////                NSLog(@"%@,%@",items.stockID,items.name);
//                }
//            } else {
//                //应答错误，显示错误信息
//                NSLog(@"股票查询请求错误，错误信息是：%@",resp.message);
//            }
//        }];

////    练习:期权-标的行情
//    MUnderlyingStockRequest *request =[[MUnderlyingStockRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MUnderlyingStockResponse *response = (MUnderlyingStockResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.stockItems;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MOptionItem *items = item[i];
//                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"期权-标的行情请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    //练习:期权-交割月列表
//    MExpireMonthRequest *request = [[MExpireMonthRequest alloc] init];
//    request.stockID = @"510050.sh";
////    request.isV2 = TRUE;
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MExpireMonthResponse *response = (MExpireMonthResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",request.ip);
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"期权-交割月列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:期权-商品行情
//    MOptionRequest *request =[[MOptionRequest alloc] init];
//    request.stockID = @"600000.sh";
//    request.pageIndex = 0;
//    request.optionType = MOptionTypeUnknown;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOptionResponse *response = (MOptionResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"1=====:%@",response);
//            NSArray *item = response.optionItems;
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MOptionItem *items = item[i];
//                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"期权-商品行情请求错误，错误信息是：%@",resp.message);
//
//        }
//    }];
    
//    //练习:期权T型报价行情
//    MOptionTRequest *request = [[MOptionTRequest alloc] init];
//    request.stockID = @"204182.sh";
//    request.expireMonth = @"2012";
//
////    发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOptionResponse *response = (MOptionResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.optionItems;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@", response);
//            for (int i=0; i<item.count; i++) {
//                MOptionItem *items = item[i];
//                NSString *ss;
//                if (items.isLimit==true) {
//                    ss=@"有";
//                }
//                else ss=@"无";
//                NSLog(@"啦啦啦%d：",i+1);
//                NSLog(@"cascasc%@",items);
////                NSLog(@"\n合约代码：%@\n标的证券代码：%@\n标的证券简称：%@\n标的证券类型：%@\n合约单位：%@\n期权行权价格：%@\n首个交易日：%@\n最后交易日：%@\n期权行权日：%@\n期权交割日：%@\n期权到期日：%@\n合约版号：%@\n前结算价：%@\n标的证券昨收：%@\n标的证券价格：%@\n有无涨跌限制：%@\n剩余天数：%@\n持仓量：%@\n隐含波动率：%@\nDelta：%@\nRho：%@\nTheta：%@\nGamma：%@\nVega：%@\n内在价值：%@\n时间价值：%@\n杠杆率：%@\n溢价率：%@\n虚实度：%@\n真实杠杆：%@\n理论价：%@\nID：%@\n",items.contractID,items.stockID,items.stockSymble,items.stockType,items.unit,items.exePrice,items.startDate,items.endDate,items.exeDate,items.deliDate,items.expDate,items.version,items.presetPrice,items.stockClose,items.stockLast,ss,items.remainDate,items.openInterest,items.impliedVolatility,items.delta,items.rho,items.theta,items.gamma,items.vega,items.inValue,items.timeValue,items.leverageRatio,items.premiumRate,items.virtualReality,items.leverage,items.theoreticalPrice,items.ID);
//            }
//        } else {
//
//            //应答错误，显示错误信息
//            NSLog(@"期权T型报价行情请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    //练习:分价量表
//    MPriceVolumeRequest *request = [[MPriceVolumeRequest alloc] init];
//    request.code = @"502056.sh";
//    request.subtype = @"1100";
//    request.param = @"0,1000,0";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MPriceVolumeResponse *response = (MPriceVolumeResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.items;
//            NSLog(@"站点显示：%@",request.ip);
//            for (int i=0;i<item.count;i++) {
//                MPriceVolumeItem *items = item[i];
//                NSLog(@"%@,%@",items.price,items.volume);
////                NSLog(@"%@", items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分价量表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    分量请求
//    MVolumeRequest *request = [[MVolumeRequest alloc] init];
//    request.code = @"502056.sh";
//    request.subtype = @"1100";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MVolumeResponse *response = (MVolumeResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"站点：%@",request.ip);
//            NSLog(@"%@",response);
////            NSLog(@"分量表数组：%@",response.volumes);
////            NSLog(@"分量表买数组：%@",response.buyVolumes);
////            NSLog(@"分量表卖数组：%@",response.sellVolumes);
////            for (int i = 0;i<response.sellVolumes.count;i++){
////                NSLog(@"%@",response);
////            }
////            for (int i=0;i<item.count;i++) {
////                MPriceVolumeItem *items = item[i];
////                NSLog(@"%@,%@",items.price,items.volume);
////            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分价量表请求错误，错误信息是：%@",resp.message);
//        }
//    }];


////    练习:买卖队列
//    MOrderQuantityRequest *request = [[MOrderQuantityRequest alloc] init];
//    request.code = @"600000.sh";
//    request.subtype = @"1001";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MOrderQuantityResponse *response = (MOrderQuantityResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"%@", response.buyItems);
//            NSArray *item = response.buyItems;
//            for (int i=0; i<item.count; i++) {
//                MOrderQuantityItem *items = item[i];
//                NSLog(@"%@",response);
//            }
////            NSArray *item1 = response.sellItems;
////            for (int i=0; i<item1.count; i++) {
////                MOrderQuantityItem *arr = item1[i];
////                NSLog(@"%@",arr);
////            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"买卖队列请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:港股其他信息
//    MHKQuoteInfoRequest *request = [[MHKQuoteInfoRequest alloc] init];
//    request.code = @"00700.hk";
//    request.subtype = @"1010";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//            if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MHKQuoteInfoResponse *response = (MHKQuoteInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//                NSLog(@"1----:%@",request.ip);
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"港股其他信息请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:假日黑名单
//    MMarketHolidayRequest *request = [[MMarketHolidayRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MMarketHolidayResponse *response = (MMarketHolidayResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"假日黑名单请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:分时明细表
//
//    MTimeTickRequest *request = [[MTimeTickRequest alloc] init];
//    request.code = @"600000.sh";
//    request.subtype = @"1001";
////    request.index = @"1.7299E8";
//    request.pageSize = 3000;
//    request.type = MTimeTickRequestTypeRecent; //最新N笔数据
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTimeTickResponse *response = (MTimeTickResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1=====:%@",response);
//            NSLog(@"%@,%@",response.startIndex,response.endIndex);
//            NSArray *item = response.items;
//            NSLog(@"%lu",(unsigned long)item.count);
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MTickItem *items = item[i];
//                NSLog(@"%@",items);
////                NSLog(@"%@,%lu,%@,%@",items.time8,(unsigned long)items.type,items.tradePrice,items.tradeVolume);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分时明细表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////     练习:分笔明细表
//    ML2TimeTickRequest *request = [[ML2TimeTickRequest alloc] init];
//    request.code = @"600000.sh";
//    request.subtype = @"1001";
////    request.index = @"0";
//    request.pageSize = 100;
//    request.type = MTimeTickRequestTypeRecent; //最新N笔数据
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            ML2TimeTickResponse *response = (ML2TimeTickResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"%@,%@",response.startIndex,response.endIndex);
//            NSArray *item = response.items;
//            NSLog(@"----%@",request.ip);
//            NSLog(@"%lu",item.count);
//            for (int i=0; i<item.count; i++) {
//                MTimeTickItem *items = item[i];
////                NSLog(@"%@,%@,%@,%lu,%lu",items.time8,items.tradePrice,items.tradeVolume,items.type,items.CFFFlag);
//                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分笔明细表请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    //练习:分笔对逐笔明细
//    MTimeTickDetailRequest *request = [[MTimeTickDetailRequest alloc] init];
//    request.code = @"601688.sh";
//    request.subtype = @"1400";
//    request.index = @"9.9726547E7";
//    request.pageSize = 20;
//    request.type = MTimeTickRequestTypeOlder;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTimeTickDetailResponse *response = (MTimeTickDetailResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"%@,%@",response.startIndex,response.endIndex);
//            NSLog(@"分笔明细如下：");
//            NSArray *item = response.tickItems;
////            NSLog(@"%@",item);
//            for (int i=0; i<item.count; i++) {
//                MTickItem *items = item[i];
//                NSLog(@"%@,%@,%@,%lu",items.time8,items.tradePrice,items.tradeVolume,(unsigned long)items.type);
//            }
//            NSLog(@"逐笔明细如下：");
//            NSArray *Arr = response.detailTickItems;
////            NSLog(@"%@",Arr);
//            for (int i=0; i<Arr.count; i++) {
//                MTimeTickItem *items = Arr[i];
//                NSLog(@"%@,%@,%@,%lu",items.time8,items.tradePrice,items.tradeVolume,(unsigned long)items.type);
//            }
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分笔对逐笔明细请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    NSArray *code = @[@"600519.sh",@"900926.sh",@"688169.sh",@"113609.sh",@"501064.sh",@"511010.sh",@"502000.sh",@"204091.sh",@"110072.sh",@"018003.sh",@"120201.sh",@"000932.sh",@"689009.sh",@"601601.sh",@"600702.sh",@"300896.sz",@"200596.sz",@"002821.sz",@"300841.sz",@"160133.sz",@"159972.sz",@"184801.sz",@"131805.sz",@"123029.sz",@"100303.sz",@"399396.sz",@"002192.sz"];
//    NSArray *subtype = @[@"1001",@"1002",@"1006",@"1300",@"1100",@"1100",@"1100",@"1311",@"1300",@"1300",@"1300",@"1400",@"1006",@"1001",@"1001",@"1004",@"1002",@"1003",@"1004",@"1100",@"1100",@"1100",@"1311",@"1300",@"1300",@"1400",@"1003"];
//    NSArray *index = @[@"4739485",@"1392636",@"410415",@"40720",@"2100",@"723232",@"24911",@"436900",@"49288",@"3361",@"10",@"2.7643914E7",@"5738454",@"5.0843154E7",@"1.2681888E7",@"923475",@"169745",@"1709724",@"1292980",@"1215051",@"610",@"4300",@"2091850",@"1359050",@"2400",@"1.088325655E9",@"1.1548791E7"
//];
//    NSLog(@"woodajsodji:::%ld",(long)code.count);
//    for (int ui = 0;ui<code.count;ui++){
//
//    //练习:逐笔明细表
//    ML2TimeTickDetailRequest *request = [[ML2TimeTickDetailRequest alloc] init];
//    request.code = @"204001.sh";
//    request.subtype = @"1300";
//    request.index = 0;
//    request.pageSize = 100;
//    request.type = MTimeTickRequestTypeRecent;
////    request.param = [NSString stringWithFormat: @"%@,20,1",index[ui]];
////    request.param = @"0,20,-1";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            ML2TimeTickDetailResponse *response = (ML2TimeTickDetailResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"下标：%@,%@,%@",response.startIndex,response.endIndex,request.code);
//            NSArray *item = response.items;
//            NSLog(@"股票代码-%ld：%@",item.count,request.code);
//            NSLog(@"%@",request.ip);
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//                MTimeTickItem *items = item[i];
////                NSLog(@"%@,%@,%@,%lu",items.time8,items.tradePrice,items.tradeVolume,items.type);
//                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"逐笔明细表请求错误，错误信息是：%@，参数：%@",resp.message,request.code);
//        }
//    }];
//    }
    
//    //练习:逐笔委托
//    ML2TimeTickDetailRequest *request = [[ML2TimeTickDetailRequest alloc] init];
//    request.code = @"600000.sh";
//    request.subtype = @"1001";
//    request.index = 0;
//    request.pageSize = 100;
//    request.type = MTimeTickRequestTypeRecent;
////    request.param = [NSString stringWithFormat: @"%@,20,1",index[ui]];
////    request.param = @"0,20,-1";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            ML2TimeTickDetailResponse *response = (ML2TimeTickDetailResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"下标：%@,%@,%@",response.startIndex,response.endIndex,request.code);
//            NSArray *item = response.items;
//            NSLog(@"股票代码-%ld：%@",item.count,request.code);
//            NSLog(@"%@",request.ip);
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//                MTimeTickItem *items = item[i];
////                NSLog(@"%@,%@,%@,%lu",items.time8,items.tradePrice,items.tradeVolume,items.type);
//                NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"逐笔明细表请求错误，错误信息是：%@，参数：%@",resp.message,request.code);
//        }
//    }];
    
////    练习:AB股
//    MABQuoteListRequest *request = [[MABQuoteListRequest alloc] init];
//    request.pageSize = 200;
//    request.field = MABQuoteListFieldChangeRateA;
//    request.ascending = YES;
//    request.pageIndex = 0;
////    request.param = @"bu,su";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MABQuoteListResponse *response = (MABQuoteListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *items = response.items;
//            NSLog(@"计数:%lu",(unsigned long)items.count);
//            for (int i = 0;i<items.count;i++){
//                MABLinkItem *item = items[i];
//                NSLog(@"1----:%@",item.codeA);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股静态数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];

    //练习:个股静态数据
//    MStaticDataRequest *request = [[MStaticDataRequest alloc] init];
//    request.code = @"600000.sh,000001.sz,00700.hk,131800.sz";
////    request.param = @"bu,su";
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStaticDataResponse *response = (MStaticDataResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股静态数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:两市港股通数据
//    MHKMarketInfoRequest *request = [[MHKMarketInfoRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MHKMarketInfoResponse *response = (MHKMarketInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",request.ip);
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"两市港股通数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:次新股
//    MSubnewStockRankingRequest *request = [[MSubnewStockRankingRequest alloc] init];
//    request.pageIndex = 0;
//    request.pageSize = 200;
//    request.ascending = YES;
//    request.field = MSubnewStockRankingFieldCode;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MSubnewStockRankingResponse *response = (MSubnewStockRankingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"1----:%@",response);
//            NSArray *item = response.items;
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MSubnewStockRankingItem *items = item[i];
////                NSLog(@"%@,%@",items.code,items.IPODate);
//                NSLog(@"%@,%ld,,%@",items.code,(long)items.continuousLimitUpDays,items.lastPrice);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"次新股请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    练习:次新债
//    MSubnewBondRankingRequest *request = [[MSubnewBondRankingRequest alloc] init];
//    request.pageIndex = 0;
//    request.pageSize = 20;
//    request.ascending = NO;
//    request.field = MSubnewBondRankingFieldIPODate;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MSubnewBondRankingResponse *response = (MSubnewBondRankingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1----:%@",response);
//            NSArray *item = response.items;
//            NSLog(@"%@",request.ip);
//            for (int i=0; i<item.count; i++) {
//                MSubnewBondRankingItem *items = item[i];
////                NSLog(@"%@,%@",items.code,items.IPODate);
//                NSLog(@"%@",items.code);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"次新债请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    NSArray *orry = @[@"600519.sh",@"900905.sh",@"689009.sh",@"600900.sh",@"600809.sh",@"688200.sh",@"511310.sh",@"501064.sh",@"502006.sh",@"502003.sh",@"113041.sh",@"204182.sh",@"110044.sh",@"019545.sh",@"120602.sh",@"300760.sz",@"200581.sz",@"002985.sz",@"300841.sz",@"300869.sz",@"300661.sz",@"000538.sz",@"159972.sz",@"160133.sz",@"159001.sz",@"184801.sz",@"123013.sz",@"131802.sz",@"101528.sz",@"111073.sz",@"600702.sh",@"002192.sz"];
//    NSArray *stbs = @[@"1001",@"1002",@"1006",@"1001",@"1001",@"1006",@"1100",@"1100",@"1100",@"1100",@"1300",@"1311",@"1300",@"1300",@"1300",@"1004",@"1002",@"1001",@"1004",@"1004",@"1004",@"1001",@"1100",@"1100",@"1100",@"1100",@"1300",@"1311",@"1300",@"1300",@"1001",@"1001"];
//    for (int i=0;i<orry.count;i++){
//    //练习:增值指标
//    MAddValueRequest *request = [[MAddValueRequest alloc] init];
//    request.code = orry[i];
//    request.subtype = stbs[i];
//    request.fields = @[@"code",@"date",@"time",@"ultraLargeBuyVolume",@"ultraLargeSellVolume",@"ultraLargeBuyAmount",@"ultraLargeSellAmount",@"largeBuyVolume",@"largeSellVolume",@"largeBuyAmount",@"largeSellAmount",@"mediumBuyVolume",@"mediumSellVolume",@"mediumBuyAmount",@"mediumSellAmount",@"smallBuyVolume",@"smallSellVolume",@"smallBuyAmount",@"smallSellAmount",@"ultraLargeNetInflow",@"largeNetInflow",@"mediumNetInflow",@"smallNetInflow",@"netCapitalInflow",@"fundsInflows",@"fundsOutflows",@"othersFundsInflows",@"othersFundsOutflows",@"lastTradeDates",@"ultraLargeDiffer",@"largeDiffer",@"mediumDiffer",@"smallDiffer",@"largeBuyDealCount",@"largeSellDealCount",@"dealCountMovingAverage",@"buyCount",@"sellCount"];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MAddValueResponse *response = (MAddValueResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1------:%@",response);
//            NSLog(@"%@",request.ip);
//            NSArray *items = response.addValueItems;
////            NSLog(@"%@",response.addValueItems);
////            for (int i=0;i<items.count;i++){
////                MAddValueItem *item = items[i];
//                [_adiccc setValue:[NSString stringWithFormat:@"%@",items] forKey:[NSString stringWithFormat:@"%d",i]];
////               NSLog(@"%@,%@,%@,%@,%@,%@",items.code,items.ultraLargeBuyVolume,items.ultraLargeSellVolume,items.largeBuyAmount,items.smallSellAmount,items.ddy);
////            NSLog(@"%@",item);
////            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"增值指标请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//    }
//    //练习:市场交易日接口
//    MTradeDateRequest *request = [[MTradeDateRequest alloc] init];
//    request.market = @"SH";//市场，如SH（沪市）,SZ（深市）,BJ（新三板）,HK（港股）,SHHK（沪港通）,SZHK（深港通）,CFF（中金所）,ZCE（郑商所）,DCE（大商所）
////    request.date = @"20200106";//交易日历
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTradeDateResponse *response = (MTradeDateResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"站点信息：%@",request.ip);
//            NSLog(@"请求数据：%@",request);
////            NSLog(@"1----:%@",response.dates[0]);
//            NSLog(@"%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"市场交易日接口请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:沪股通和深股通额度数据接口
//    MHSAmountRequest *request = [[MHSAmountRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MHSAmountResponse *response = (MHSAmountResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",request.ip);
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"沪股通和深股通额度数据接口请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////练习:沪股通和深股通额度接口（合并）
//    MHSAmountAllRequest *request = [[MHSAmountAllRequest alloc] init];
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MHSAmountAllResponse *response = (MHSAmountAllResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            MHKTQuotaItem *items = response.hktQuoteItem;
//            NSLog(@"1----:%@",request.ip);
//            NSLog(@"1----:%@",items);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"沪股通和深股通额度数据接口请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
////    练习：港股价差数据接口
//    for(int i = 0;i<3;i++){
//        MHKPriceDiffRequest *request = [[MHKPriceDiffRequest alloc] init];
//
//
//        //发送请求
//        [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//            if (resp.status == MResponseStatusSuccess) {
//                //应答无误，处理数据更新画面
//                MHKPriceDiffResponse *response = (MHKPriceDiffResponse *)resp;
//                NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//                NSLog(@"1----:%@",request.ip);
//                NSLog(@"1----:%@",response);
//            } else {
//                //应答错误，显示错误信息
//                NSLog(@"港股价差数据请求错误，错误信息是：%@",resp.message);
//            }
//        }];
//    }
    
////    练习:交易行情数据接口
//    MTradeQuoteRequest *request = [[MTradeQuoteRequest alloc] init];
//    request.code = @"600519.sh";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTradeQuoteResponse *response = (MTradeQuoteResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            MTradeItem *item = response.tradeItem;
//            NSLog(@"站点信息：%@",request.ip);
//            NSLog(@"oo：%@",item);
////            NSLog(@"价格档位:%@/买数量单位:%@/卖数量单位:%@",item.priceUnit,item.buyVolumeUnit,item.sellVolumeUnit);
//////            NSLog(@"\n限价买数量上限：%@,\n限价卖数量上限：%@,\n市价买数量上限：%@,\n市价卖数量上限：%@,\n买数量上限：%@,\n卖数量上限：%@,\n市价买数量单位：%@,\n市价卖数量单位：%@,\n盘后定价交易业务参考信息买数量单位：%@,\n盘后定价交易业务参考信息卖数量单位：%@",item.buyQtyUpperLimit,item.sellQtyUpperLimit,item.marketBuyQtyUpperLimit,item.marketSellQtyUpperLimit,item.AFBuyQtyUpperLimit,item.AFSellQtyUpperLimit,item.marketBuyQtyUnit,item.marketSellQtyUnit,item.AFBuyQtyUnit,item.AFSellQtyUnit);
//            //            NSLog(@"%@,%@,%@,%@,%@,%@,%@,%ld,%@,%@,%@,%@,%@,%@",item.buyPrices,item.buyVolumes,item.sellPrices,item.sellVolumes,item.lastPrice,item.changeRate,item.change,item.changeState,item.limitUp,item.limitDown,item.buyVolumeUnit,item.sellVolumeUnit,item.priceDiffType,item.priceUnit);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"交易行情数据接口请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:正股与可转债联动
//        MLinkQuoteRequet *request = [[MLinkQuoteRequet alloc] init];
//        request.code = @"127008.sz";
//        //发送请求
//        [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//            if (resp.status == MResponseStatusSuccess) {
//                //应答无误，处理数据更新画面
//                MLinkQuoteResponse *response = (MLinkQuoteResponse *)resp;
//                NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//                self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//                for (int i=0;i<response.items.count;i++){
//                    MLinkItem* item = response.items[i];
//                    NSLog(@"%@",item);
//                }
//            } else {
//                //应答错误，显示错误信息
//                NSLog(@"正股与可转债联动接口请求错误，错误信息是：%@",resp.message);
//            }
//        }];

    
////    练习:F10通用
//    MF10Request *request = [[MF10Request alloc] init];
//    request.code = @"510120.sh"; //填入股票代码
//    request.requestType = MF10RequestTypeFundholdings10;
//    request.sourceType = MF10DataSourceCH;
////    request.param = @{@"param":@"0,200"};
////    request.param = @{@"type":@"new",@"param":@"0,500"};//当传入此参数时，数据返回发布公告
////    request.param = @{@"type":@"ADVAPAYM_0"};
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MF10Response *response = (MF10Response *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response.JSONObject);
//            NSLog(@"1----:%@",request.requestType);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"大事提醒请求错误，错误信息是：%@",resp.message);
//        }
//    }];

 
////    练习:最新指标
//    MLatestIndexRequest *request = [[MLatestIndexRequest alloc] init];
//    request.code = @"000002.sz"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MLatestIndexResponse *response = (MLatestIndexResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"最新指标请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
//    //练习:大事提醒
//    MBigEventNotificationRequest *request = [[MBigEventNotificationRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBigEventNotificationResponse *response = (MBigEventNotificationResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"大事提醒请求错误，错误信息是：%@",resp.message);
//        }
//    }];

////    练习:分红配送
//    MBonusFinanceRequest *request = [[MBonusFinanceRequest alloc] init];
//    request.code = @"302002.sz"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBonusFinanceResponse *response = (MBonusFinanceResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分红配送请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:融资融券
//    MTradeDetailInfoRequest *request = [[MTradeDetailInfoRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTradeDetailInfoResponse *response = (MTradeDetailInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"融资融券请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:机构预测
//    MForecastYearRequest *request = [[MForecastYearRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MForecastYearResponse *response = (MForecastYearResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"机构预测请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:机构评等
//    MForecastRatingRequest *request = [[MForecastRatingRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MForecastRatingResponse *response = (MForecastRatingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"机构评等请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:基本情况
//    MCompanyInfoRequest *request = [[MCompanyInfoRequest alloc] init];
//    request.code = @"501022.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MCompanyInfoResponse *response = (MCompanyInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"基本情况请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:主要业务
//    MCoreBusinessRequest *request = [[MCoreBusinessRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MCoreBusinessResponse *response = (MCoreBusinessResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"主要业务请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:管理层
//    MLeaderPersonInfoRequest *request = [[MLeaderPersonInfoRequest alloc] init];
//    request.code = @"600075.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//
//        //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MLeaderPersonInfoResponse *response = (MLeaderPersonInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"管理层请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:财务指标
//    MFinancialSummaryRequest *request = [[MFinancialSummaryRequest alloc] init];
//    request.code = @"00700.hk"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//    request.param = nil;
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFinancialSummaryResponse *response = (MFinancialSummaryResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"财务指标请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    练习:财务报表
//    MFinancialInfoRequest *request = [[MFinancialInfoRequest alloc] init];
//    request.code = @"00700.hk"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//    request.param = @{@"type":@"N"};
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFinancialInfoResponse *response = (MFinancialInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"财务报表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:股本结构
//    MStockShareInfoRequest *request = [[MStockShareInfoRequest alloc] init];
//    request.code = @"832003.bj"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockShareInfoResponse *response = (MStockShareInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"股本结构请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:股本变动
//    MStockShareChangeInfoRequest *request = [[MStockShareChangeInfoRequest alloc] init];
//    request.code = @"832003.bj"; //填入股票代码
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockShareChangeInfoResponse *response = (MStockShareChangeInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"股本变动请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:股东变动
//    MShareHolderHistoryInfoRequest *request = [[MShareHolderHistoryInfoRequest alloc] init];
//    request.code = @"000031.sz"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MShareHolderHistoryInfoResponse *response = (MShareHolderHistoryInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"股东变动请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:最新自然人持股
//    MTopLiquidShareHolderRequest *request = [[MTopLiquidShareHolderRequest alloc] init];
//    request.code = @"603876.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTopLiquidShareHolderResponse *response = (MTopLiquidShareHolderResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"最新十大流通股股东请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:最新机构持股
//    MTopShareHolderRequest *request = [[MTopShareHolderRequest alloc] init];
//    request.code = @"002929.sz"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTopShareHolderResponse *response = (MTopShareHolderResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"十大机构股东请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
    //练习:最新基金持股
//    MFundShareHolderInfoRequest *request = [[MFundShareHolderInfoRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
//    request.sourceType = MF10DataSourceGA;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundShareHolderInfoResponse *response = (MFundShareHolderInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"最新基金持股请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:财经资讯列表
//    MNewsListRequest *request = [[MNewsListRequest alloc] init];
//    request.newsType = MNewsTypeIndustry;
//    //request.pageIndex = 0;
//    request.sourceType = MF10DataSourceGA;
//    request.newsID = @"nil";
//    request.type = F10NewsRequestTypeRecent;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MNewsListResponse *response = (MNewsListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",request.ip);
//            NSLog(@"1----:%@",request);
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"财经资讯列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    练习:财经资讯明细
//    MNewsRequest *request = [[MNewsRequest alloc] init];
//    request.newsID = @"87054397612"; //填入新闻序号
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MNewsResponse *response = (MNewsResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"财经资讯明细请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:个股公告列表
//    MStockBulletinListRequest *request = [[MStockBulletinListRequest alloc] init];
//    request.code = @"600035.sh"; //填入股票代码
////    request.pageIndex = 0;
//    request.pageSize = 100;
//    request.sourceType = MF10DataSourceCH;
////    request.newsID = @"200056.sz_4964741";
//    request.type = F10NewsRequestTypeRecent;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockBulletinListResponse *response = (MStockBulletinListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            //NSLog(@"1----:%@",response);
//            NSArray *item = response.stockBulletinItems;
//            for (int i=0; i<item.count; i++) {
//                MStockNewsItem *items = item[i];
//                NSLog(@"%@,%@,%@,%@,%ld,%@,%@,%@",items.ID,items.datetime,items.entryDate,items.entryTime,items.isPDF,items.source,items.stockName,items.title);
//            }
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股公告列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
   
    //练习:个股公告明细
//    MStockBulletinRequest *request = [[MStockBulletinRequest alloc] init];
//    request.stockBulletinID = @"200045.sz_5117660"; //填入公告序号
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockBulletinResponse *response = (MStockBulletinResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股公告明细请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:个股新闻列表
//    MStockNewsListRequest *request = [[MStockNewsListRequest alloc] init];
//    request.code = @"600600.sh"; //填入股票代码
////    request.pageIndex = 2;
//    request.pageSize = 50;
//    request.sourceType = MF10DataSourceCH;
////    request.newsID = @"600600.sh_20190415020008235096";
//    request.type = F10NewsRequestTypeRecent;

//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockNewsListResponse *response = (MStockNewsListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSArray *item = response.stockNewsItems;
//            for (int i=0; i<item.count; i++) {
//                MStockNewsItem *items = item[i];
//                NSLog(@"%@,%@,%@",items.ID,items.datetime,items.title);
//                //NSLog(@"%@",items);
//            }
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股新闻列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:个股新闻明细
//    MStockNewsRequest *request = [[MStockNewsRequest alloc] init];
//    request.stockNewsID = @"600600.sh_20191224020010280269"; //填入公告序号
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockNewsResponse *response = (MStockNewsResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股新闻明细请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    //练习:个股研报列表
//    MStockReportListRequest *request = [[MStockReportListRequest alloc] init];
//    request.code = @"600000.sh"; //填入股票代码
////    request.pageIndex = 0;
//    request.pageSize = 20;
//    request.sourceType = MF10DataSourceCH;
//    //request.newsID = @"000001.sz_4308797 ";
//    request.type = F10NewsRequestTypeRecent;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockReportListResponse *response = (MStockReportListResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//            NSArray *item = response.stockReportItems;
//            for (int i=0; i<item.count; i++) {
//                MStockNewsItem *items = item[i];
//                NSLog(@"%@,%@,%@",items.ID,items.datetime,items.title);
//                //NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股研报列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
////
    //练习:个股研报明细
//    MStockReportRequest *request = [[MStockReportRequest alloc] init];
//    request.stockReportID = @"600519.sh_4631669"; //填入公告序号
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MStockReportResponse *response = (MStockReportResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//            NSArray *item = response.stockReportDetailItem;
//            for (int i=0; i<item.count; i++) {
//            MStockNewsItem *items = item[i];
//            NSLog(@"%@,%@,%@",items.ID,items.datetime,items.title);
//                //NSLog(@"%@",items)
//
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"个股研报明细请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:新股(债)上市日期信息
//    MIPODateRequest *request = [[MIPODateRequest alloc] init];
//    request.sourceType = MF10DataSourceCH;
//    request.type = MIPOTypeStock;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MIPODateResponse *response = (MIPODateResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"新股上市日期信息请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习:新股(债)列表
//    MIPOCalendarRequest *request = [[MIPOCalendarRequest alloc] init];
//    request.date = @"2020-11-17";
//    request.sourceType = MF10DataSourceCH;
//    request.type = MIPOTypeStock;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MIPOCalendarResponse *response = (MIPOCalendarResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
////            NSLog(@"1----:%@",response.info);
//            NSDictionary *item = response.info;
//            NSLog(@"1----:%@",item);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"新股列表请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
////    练习:新股(债)详情
//    MIPOShareDetailRequest *request = [[MIPOShareDetailRequest alloc] init];
//    request.code = @"302002.sz";
//    request.sourceType = MF10DataSourceCH;
////    request.type = MIPOTypeBond;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MIPOShareDetailResponse *response = (MIPOShareDetailResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"新股详情请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//
//    //练习:基金净值
//    MFundValueRequest *request = [[MFundValueRequest alloc] init];
//    request.code = @"502058.sh";
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundValueResponse *response = (MFundValueResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"基金净值请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:基金概况
//    MFundBasicInfoRequest *request = [[MFundBasicInfoRequest alloc] init];
//    request.code = @"502024.sh";
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundBasicInfoResponse *response = (MFundBasicInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"基金概况请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:基金净值(5天)
//    MFundNetValueRequest *request = [[MFundNetValueRequest alloc] init];
//    request.code = @"510050.sh";
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundNetValueResponse *response = (MFundNetValueResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"基金净值请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:资产配置
//    MFundAssetAllocationRequest *request = [[MFundAssetAllocationRequest alloc] init];
//    request.code = @"500058.sh";
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundAssetAllocationResponse *response = (MFundAssetAllocationResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response.records);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"资产配置请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:行业组合
//    MFundIndustryPortfolioRequest *request = [[MFundIndustryPortfolioRequest alloc] init];
//    request.code = @"833382.bj";
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundIndustryPortfolioResponse *response = (MFundIndustryPortfolioResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"行业组合请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:股票组合
//    MFundStockPortfolioRequest *request = [[MFundStockPortfolioRequest alloc] init];
//    request.code = @"833382.bj";
//    request.sourceType = MF10DataSourceGA;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundStockPortfolioResponse *response = (MFundStockPortfolioResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"股票组合请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:份额结构
//    MFundShareStructRequest *request = [[MFundShareStructRequest alloc] init];
//    request.code = @"833382.bj";
//    request.sourceType = MF10DataSourceCH;
//    
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundShareStructResponse *response = (MFundShareStructResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"份额结构请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:基金财务
//    MFundFinanceRequest *request = [[MFundFinanceRequest alloc] init];
//    request.code = @"833382.bj";
//    request.sourceType = MF10DataSourceGA;
//        
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundFinanceResponse *response = (MFundFinanceResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//                
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"基金财务请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:基金分红
//    MFundDividendRequest *request = [[MFundDividendRequest alloc] init];
//    request.code = @"502049.sh";
//    request.sourceType = MF10DataSourceCH;
//        
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MFundDividendResponse *response = (MFundDividendResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//                
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"基金分红请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:债券概况
//    MBondBasicInfoRequest *request = [[MBondBasicInfoRequest alloc] init];
//    request.code = @"113009.sh";
//    request.sourceType = MF10DataSourceCH;
//        
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBondBasicInfoResponse *response = (MBondBasicInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);f fe
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"债券概况请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:付息情况
//    MBondInterestPayRequest *request = [[MBondInterestPayRequest alloc] init];
//    request.code = @"113503.sh";
//    request.sourceType = MF10DataSourceGA;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBondInterestPayResponse *response = (MBondInterestPayResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1=====:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"付息情况请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:债券回购
//    MBondBuyBacksRequest *request = [[MBondBuyBacksRequest alloc] init];
//    request.code = @"128009.sz";
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        NSLog(@"%ld", (long)resp.status);
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MBondBuyBacksResponse *response = (MBondBuyBacksResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"债券回购请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:分级基金
//    MGradeFundRequest *request = [[MGradeFundRequest alloc] init];
//    request.code = @"502004.sh";
//    request.gradeFundType = MGradeFundTypeInfo;
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MGradeFundResponse *response = (MGradeFundResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分级基金请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
//    练习:融资融券--分市场提供最近交易日融资融券数据
//    MMarginInfoRequest *request = [[MMarginInfoRequest alloc] init];
//    request.market = @"sh_sz";//市场
//    request.field = @"FINBALANCE";
//    request.pageIndex = 1;
//    request.pageSize = 10;
//    request.ascending = NO;
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MMarginInfoResponse *response = (MMarginInfoResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"融资融券--分市场请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    //练习:融资融券--融资融券差额接口(最近90天)
//    MMarginInfoDiffRequest *request = [[MMarginInfoDiffRequest alloc] init];
//    request.market = @"sh_sz";
//    request.pageIndex = 0;
//    request.pageSize = 20;
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MMarginInfoDiffResponse *response = (MMarginInfoDiffResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"融资融券--融资融券差额请求错误，错误信息是：%@",resp.message);
//        }
//    }];

//    练习:融资融券--个股融资融券接口（最近90天）
//    MMarginInfoShareRequest *request = [[MMarginInfoShareRequest alloc] init];
//    request.code = @"600000.sh";
//    request.pageIndex = 0;
//    request.pageSize = 90;
//    request.sourceType = MF10DataSourceCH;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MMarginInfoShareResponse *response = (MMarginInfoShareResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"融资融券--个股融资融券请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////  练习: 涨停商品行情请求类
//    MTongLineRequest *request = [[MTongLineRequest alloc] init];
//    request.type = @"hst";
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MTongLineResponse *response = (MTongLineResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"1----:%@",response.items);
//            NSLog(@"1----:%ld",(long)[response.items[response.items.count-1].SZInflowAmount integerValue]);
//            NSLog(@"%f",(CGFloat)793928049/3000000000);
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"融资融券--个股融资融券请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
////    练习: 涨停商品行情请求类
//    MZTSortingRequest *request = [[MZTSortingRequest alloc] init];
//    request.pageIndex = 0;
//    request.pageSize = 200;
//    request.field = MZTSortingFieldZTDatatime;
//    request.ascending = 1;
//    request.type = MZTSortingTypeALL;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MZTSortingResponse *response = (MZTSortingResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"%@",request.ip);
//            NSLog(@"1----:%@",response);
//
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"涨停商品行情请求错误，错误信息是：%@",resp.message);
//        }
//    }];
    
    
}

-(void)triggerStorage
{
    if (self.data == nil) {
        NSLog(@"暂时未受到数据，稍后重试");
    } else {
        NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
        NSString *path=[paths    objectAtIndex:0];
        NSString *filename=[path stringByAppendingPathComponent:@"test.plist"];   //获取路径
        NSLog(@"%@",path);
        NSFileManager* fm = [NSFileManager defaultManager];
        [fm createFileAtPath:filename contents:nil attributes:nil];
        //NSDictionary* dic = [NSDictionary dictionaryWithContentsOfFile:plistPath];
        //写入数据
        NSDictionary * dict1=self.data;
        BOOL isSuccess = [dict1 writeToFile:filename atomically:YES];
        if (isSuccess) {
            NSLog(@"成功啦！");
        } else {
            NSLog(@"失败啦！");
        }
    }


}

//-(void)ceshi
//{
//    MChartIndexRequest *request = [[MChartIndexRequest alloc] init];
//    request.code = @"688009.sh"; //填入股票代码
//    request.type = MChartIndexTypeDefault;
//    request.beginIndex = 0;
//    request.endIndex = 50;
//
//    //发送请求
//    [MApi sendRequest:request completionHandler:^(MResponse *resp) {
//        if (resp.status == MResponseStatusSuccess) {
//            //应答无误，处理数据更新画面
//            MChartIndexResponse *response = (MChartIndexResponse *)resp;
//            NSDictionary * dic=[self getDictionaryFromObject_Ext:response];
//            self.data=[NSDictionary dictionaryWithObjectsAndKeys:dic,NSStringFromClass([response class]), nil];
//            NSLog(@"站点信息:%@",request.ip);
//            NSArray *item = response.OHLCItems;
//            NSLog(@"%ld",item.count);
//            for (int i=0; i<item.count; i++) {
//            MOHLCItem *items = item[i];
//            NSLog(@"%@",items);
//            }
//        } else {
//            //应答错误，显示错误信息
//            NSLog(@"分时走势指标数据请求错误，错误信息是：%@",resp.message);
//        }
//    }];
//}


@end

